Showing 10 of 1,280 results.

Laravel Array Helper Function: array_get

get($array, $key, $default = null) The get helper method will retrieve an item from the given $array using dot notation. This allows developers to retrieve items from the array at arbitrary depths quickly, without having to use PHP's array syntax....

Laravel Artisan Database Command: The db:seed Command

The db:seed command is used to add records to a database automatically using a Seeder ( Illuminate\Database\Seeder ) class to generate or provide the records. The db:seed defines three options: class , database and force . The class option can be...

Laravel Collection Public API: push

push($value) The push method is the logical opposite of the prepend method and will push an item onto the end of the collection. The push method returns a reference to the original collection instance. The following code example shows how to use...

Laravel Array Helper Function: array_dot

The dot helper method will take a multi-dimensional array and return a new associative array where the keys are built from all the nested keys, separated with the . character. The signature for the dot helper method is: dot($array, $prepend = '')...

Laravel Router Helper Function: resource

resource($name, $controller, array $options = []) The resource function is a shortcut that is used to register a resource controller with the router. It accepts the $name of the route to create, the name of the $controller and an array of $options...

Laravel Collection Public API: sum

sum($callback = null) The sum is a simple method that returns the sum of all items in a collection. It also defines a $callback parameter which can be used to tell the sum method which values of the collection should be added together. If no items...

Laravel String Helper Function: str_replace_first

The replaceFirst helper method is used to replace the first occurrence of a given $search string with the provided $replace string in the $subject string. All three parameters are required and must be strings. The signature for the replaceFirst...

Laravel 5: Retrieving Environment Variables With env

The env helper function is used to retrieve the value of an environment variable. You may supply a $default value to be returned if there is no value currently set for the provided $key .The signature of the env function is: 1 function env ( 2 $...

Filter Search