Typetron provides a hand full of build-in helper methods that you can use to speed up the development process.
empty
- Returns true if the array is empty:
random
- Returns a random item from the array:
randomIndex
- Returns a random index from the array:
findWhere
- Just like find
method from array, findWhere
finds an item based on a key/value condition:
pluck
- Returns all the values for a key in a simple array list:
remove
- Removes an item from the array:
where
- Filters and array based on a key/value pair condition
whereIn
- Filters and array based on a key/values pair condition where value is an array:
groupBy
- Groups the array by a given key or a given callback
unique
- returns all the unique values from an array
sum
- sums values of an array
random
- Returns a random string:
capitalize
- Makes the first character uppercase
limit
- Limits the length of a string
random
- Returns a random integer number: