Showing 10 of 2,144 results.

Creating Our Own make() Method | Laravel Paginator Pretty URLs

We are going to need to resolve some things out of the IoC, so make sure to use the Illuminate\Support\Facades\App facade. In our PrettyPaginator class, add the following function: 1 ... 2 3 /** 4 * Get a new pretty paginator instance. 5 * 6 *...

Special Cases for Laravel's Singular Pluralization Feature

Any words, or word endings, in the following table will not be affected by the singular method. This is either because the resulting word is already singular, or because there is no inflection available. Word endings are denoted by the prefix * :...

Laravel Array Helper Function: array_first

first($array, callable $callback = null, $default = null) Let's begin discussing the first helper method be examining the $callback . The $callback is a function that accepts a $key and a $value as its parameters. The following code sample is an...

registerCommand($command) | The Laravel Framework Console Kernel

The registerCommand method is used to register a command with the console application. In older versions of Laravel, it was required to use this method to register any custom commands with the console kernel. The registerCommand method expects a...

Laravel Collection Public API: pluck

pluck($value, $key = null) The pluck method is used to retrieve the a list of values from the collection. It defines two parameters: $value and $key . The $value indicates which property should become the value in the resulting collection and the...

Laravel Collection Public API: lists

lists($value, $key = null) The lists method is an alias of the pluck method. The lists method is used to retrieve the a list of values from the collection. It defines two parameters: $value and $key . The $value indicates which property should...