Showing 10 of 1,322 results.

Laravel MessageBag Public API: get

…The very first message ' ( length = 39 ) 3 1 => string ' The message was: The second message ' ( length = 35 )This article is the start of a mini-series about Laravel's ErrorMessageBag component. Click through the rest of the articles to continue...

Laravel Collection Public API: flatMap

flatMap(callable $callback) The flatMap method is used in the same way as the map (discussed in the Laravel Collection Public API: map article) method but will collapse the resulting collection. The following two code examples are equivalent: 1...

Laravel MessageBag Public API: first

…2 3 // <li>This is a message</li> 4 $ message = $ messageBag -> first ( ' first ' , ' <li>:message</li> ' ) ;This article is the start of a mini-series about Laravel's ErrorMessageBag component. Click through the rest of the articles to continue...

Laravel Array Helper Function: array_set

set(&$array, $key, $value) The set helper method is the logical opposite of the forget (discussed in the Laravel Array Helper Function: array_forget article) method. its purpose is to set values within an array. The set method also uses dot...

Notes on Decimals | Laravel String Pluralization

In the previous example, trying to match the number 3.4 will throw an instance of InvalidArgumentException . To match any possible number, including decimals, for the previous translation messages, the explicit number groups must be replaced with...

Laravel: Calling Artisan Commands From Your Application

…command from within your application and 6 // pass an argument. 7 Artisan :: call ( ' db:seed ' , array ( ' --class ' => ' UserTableSeeder ' ) ) ; 8 } ) ;When calling Artisan commands from your application, such as running migrations (if you are...

Laravel Artisan Queue Command: The queue:restart Command

The queue:restart command can be used to indicate to all daemon queue workers that they should restart. This command simply instructs the queue works to restart after they are done working on their current job. This command defines no options or...

Laravel 5: Sorting Arrays With sort

The sort helper method will allow you to sort the given $array based on some condition returned by the $callback . The method works by iterating over all the values in the $array and passing the values it finds into the $callback function. It then...