Showing 10 of 2,044 results.

Laravel 5 Collections: Retrieving Collection Elements With all

The all method can be used to retrieve the underlying array that the collection is using to hold its data.The signature of the all method is: 1 public function all ( ) ;The following code demonstrates the usage of the all method: 1 use Illuminate...

Example Use | Laravel 5: String Translation Public API

The following code examples will demonstrate the usage of the has method. The results of method call will appear above the method call as a comment. 1 // Get a translator instance from the Service Container. 2 $ translator = app ( ' translator ' )...

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

Antlers Conditional Parameters Using void Parameters

…using a standard if/else block to change the parameters that are being sent to the Collection tag. This works fine if the template is relatively small, but can get unwieldy as the size of the template inside the Collection tag pair grows: 1 --- 2...

Laravel Collection Public API: prepend

prepend($value, $key = null) The prepend method will add an a given $value to the beginning of the collection. You can also supply an optional $key that will be used as the key for the new $value when adding an item to the beginning of an...