Showing 10 of 1,280 results.

Laravel Artisan Queue Command: The queue:flush Command

The queue:flush command is used to clear the log of failed queue jobs. It accepts no arguments or options and can be called like so: 1 # Flush all the failed queue jobs. 2 php artisan queue:flush This command will remove all entries from the...

Laravel Artisan Queue Command: The queue:listen Command

The queue:listen command is used to listen for and process jobs as they are added to the job queue. The command defines numerous parameters and options that can be used to customize how the queue listener interacts with and behaves under different...

Laravel 5: Returning In-line Access to a Variable With with

The with is a useful utility function that can be used to simply return the provided values back to the caller. This can be used as an entry point for method chaining without the need to create temporary local variables. It is also possible to...

Laravel 5: Generating URLs to Controller Actions With action

The action helper function can be used to generate a URL to a controller action, which is supplied as an argument to the $name parameter. If the controller action requires or accepts parameters these can be supplied by utilizing the $parameters...

Laravel Collection Public API: last

last(callable $callback = null, $default = null) The last method is the logical opposite of the first method, and is used to get the last item in a collection, or to get the last item in a collection that matches a certain criteria. A $callback...

Laravel 5: Creating Eloquent Models for Testing With factory

The factory function is used to create Eloquent models, and is generally used when testing an application to generate sample data.The signature of the factory function is: 1 function factory ( 2 $ class 3 ) ; 4 5 function factory ( 6 $ class , 7...

Laravel 5 Macros: Creating Callback Macros

The first method of creating macros we will explore is the callback function macro. These macros are added to the various classes directly by calling the macro method on the macroable class and then supplying the callback function that will be...