Showing 10 of 2,055 results.

Pint Temporary Directory | Formatter Configuration and Usage

…from Blade templates and place them in a temporary file to supply to Laravel Pint. By default this directory is located at node_modules/prettier-plugin-blade/_temp . Temporary files are automatically cleaned up after formatting each Blade...

Laravel Array Helper Function: array_sort

sort($array, callable $callback) 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...

But Why? | Lambdas And Closures

…e task. Like when we define routes in Laravel, it would be cumbersome to have to create a new function in the global scope every time we wanted to define a new route. Another use of anonymous functions is to pass them as function arguments. For...

Laravel 5: Accessing Session Input Data With old

The old helper function is used to retrieve an old input item. It is a shortcut to calling the Illuminate\Http\Request::old instance method. It accepts a $key argument and a $default argument. They $key should be the name of the input item to...

Example Use | Laravel 5: String Translation Public API

In the following example, we will change the translator's default locale to es : 1 // Ask the Service Container for a translator instance. 2 $ translator = app ( ' translator ' ) ; 3 4 // Change the default locale to `es`. 5 $ translator ->...