Showing 10 of 1,280 results.

Laravel 5: Conditionally Throwing Exceptions With throw_if

The throw_if function can be used to throw an exception if the supplied $boolean value evaluates to true . The supplied $parameters will be passed along to the exception's constructor.The signature of the throw_if function is: 1 function throw_if...

Laravel 5: Managing HTTP Cookies With cookie

The cookie function is generally used to create a new instance of the \Symfony\Component\HttpFoundation\Cookie class. If the supplied $name is null an implementation of \Illuminate\Contracts\Cookie\Factory (which is an instance of...

Laravel String Helper Function: limit

The limit method will make sure that the $value is never longer than the given limit. If it is, the length is reduced and the specified end is added as a suffix. This method is useful when displaying output from a user that could be very long and...

Laravel Artisan General Command: The clear-resets Command

The auth:clear-resets can be used to remove expired password reset tokens from the database. The command defines an optional name parameter which can be used which password broker will be used when removing the expired reset tokens (by default the...

Laravel Collection Public API: each

each(callable $callback) The each method accepts a $callback which will be called on each item in the collection. If the $callback returns false , the each method will break from its iterator and return a reference back to the original Collection...

Laravel Helper Function: csrf_token

csrf_token() The csrf_token (cross-site request forgery token) function is a shortcut for retrieving the CSRF token from the session storage. The following is an example of what the csrf_token function may output: 1 <?php 2 3 //...

Laravel Router Helper Function: delete

delete($uri, $action) The delete function is a shortcut to registering a route with the router that responds to the DELETE HTTP verb. The $uri is the URI of the route, such as / or login . The $action is what will be executed by the router when...

Laravel Artisan Generator Command: The make:model Command

The make:model command is used to generate new Eloquent model classes. It requires a name to be supplied; this name will become the name of the generated class and created file. A migration file can also be generated for the model by setting the...

Filter Search