Showing 10 of 2,044 results.

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 ->...

Example Use | Laravel 5: String Translation Public API

In the following example, we will use the setFallback method to change the current fallback locale to it : 1 <?php 2 // Ask the Service Container for a translator instance. 3 $ translator = app ( ' translator ' ) ; 4 5 // Set the fallback locale...

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 Artisan Migration Command: The migrate:reset Command

…t. Default behavior is to not run migrations in a production environment. --pretend Does not run any migrations and instead displays the SQL queries that would be run. The default behavior is to run the migrations. The following examples...

The "search" Filters

The search filter(s) are similar to the like filters such that it allows you to filter comments based on some text input. However, the search filter will perform a full-text, fuzzy search (without wildcards) across multiple comment properties.The...

A Practical Use Case | Building a Simple Statamic Request Addon

So where would we use a tag like this? I personally like to use this on search pages to display a search form to the user if they navigate directly to the search results page without entering a search query (this technique has been implemented on...

Laravel Artisan Generator Command: The make:job Command

The make:job command is used to create a new job class. A name must be supplied that will be used as the name of the newly generated class and file. An optional --sync flag can be set to indicate that the created job should be synchronous....

Gazelle | The Statamic Add-on Roundup

The Gazelle add-on is just a way for Antlers templates to detect if the client has JavaScript enabled or not. It uses a meta redirects to indicate that JavaScript is not enabled. Not a limitation of Statamic, just a curiosity.

Laravel Application Helper: old

old($key = null, $default = null) 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...