Showing 10 of 1,278 results.

Laravel Miscellaneous Helper Function: object_get

object_get($object, $key, $default = null) 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 supplied object will have a given...

Laravel Collection Public API: flip

flip The flip method will return a new Collection instance where are the all the collection item's keys have been exchanged with their corresponding values. The following code example demonstrates the effects of the flip method: 1 <?php 2 3 use...

Laravel 5: Randomizing Element Order With shuffle

The shuffle method can be used to shuffle an input array and then returns the results. This method takes advantage of PHP's shuffle method; therefore, it is not suitable for cryptographic purposes.The signature of the shuffle method is: 1 public...

Laravel Array Helper Function: array_add

The add helper method adds the given $key and $value to an $array if the $key doesn't already exist within the given $array . The signature for the add helper method is: add($array, $key, $value) Consider the following code snippet: 1 use...

Laravel 5 Message Bags: Retrieving the First Message With first

The first method will return the first message in the MessageBag instance for a given $key . If the $key is null the first method will return the first message in the MessageBag instance. If there are no messages stored within the message bag, the...

Laravel 5.5 String Helper Method: kebab

The snake helper method replaces all uppercase letters within the string with the lower cased variant prefixed with the - character. The only exception to this rule is that if the first character of the string is capitalized, it will be replaced...

Laravel Artisan Route Command: The route:clear Command

The route:clear command is used to clear any previously generated route cache files. It does this by removing the bootstrap/cache/routes.php cache file. It defines no parameters or options can can be called like so: 1 # Clear the route cache file....

Laravel Artisan Route Command: The route:list Command

The route:list command can be used to show a list of all the registered routes for the application. This command will display the domain, method, URI, name, action and middleware for the routes it includes in the generated table. The following...

Filter Search