Showing 10 of 1,278 results.

Laravel 5 Collections: Randomizing Element Order With shuffle

The shuffle method is used to rearrange the items of the array in a random distribution. The shuffle method will return a new collection and will not modify the original collection instance.1 public function shuffle ( 2 $ seed = null 3 ) ;The...

Laravel 5: Retrieving Object Values With object_get

The object_get allows developers to retrieve properties from a given $object using dot notation. This is useful in situations where it can not be guaranteed that a provided object will have a given property, identified by the given $key .The...

Laravel Array Helper Function: array_flatten

The flatten helper method is similar to the dot method in that it takes a multi-dimensional array and transforms it into a new array with only one dimension. While the dot method preserves the keys by separating them with dots , the flatten method...

Laravel Artisan Cache Command: The cache:table Command

The cache:table command is used to create a new migration for the cache database table. This table is required to use the database cache driver. This command defines no parameters and can be used like so: 1 php artisan cache:table The migration...

Laravel String Helper Function: finish

The finish helper method will make sure that a given $value always ends with exactly one occurrence of the $cap . This helper method is incredibly useful when construction URIs or file paths. The $cap can be any string of characters, and does not...

Laravel Artisan Cache Command: The cache:clear Command

The cache:clear command can be used to clear the applications cache files. The command defines an optional store parameter which can be used to change which cache store is cleared. By default the store parameter will be set to whatever value is...

Laravel Collection Public API: diff

diff($items) The diff method is used to determine which items in the collection are not present in the supplied $items collection. $items can be be either an array, or another instance of Collection . The diff method returns a new instance of...

Filter Search