Showing 10 of 1,280 results.

Laravel 5: Conditionally Retrieving Array Values With where

The where helper method is functionally similar to the pluck method, in that both take a source $array and filter it to produce a smaller array. It works by iterating over each element in the $array and executing the $callback on each key value...

Laravel Collection Public API: collapse

collapse The collapse method combines all the first-level items of a collection into a new, single collection. The returned value of the collapse method is an instance of the Collection class. We will create a simple collection to work with like...

Laravel 5: Checking if a Variable Holds a Value With filled

The filled helper function is the logical opposite of the blank helper function, and can be used to quickly determine if the provided value has a non-null, or non-empty value. The provided $value is considered filled if any of the following...

Laravel Array Helper Function: array_has

has($array, $key) The has helper method will return a boolean value that indicates if the given $key exists in the supplied $array , using dot notation. This method is incredibly useful when checking if an array has a specific key at an arbitrary...

Laravel 5 Macros: Call and Callstatic

The Macroable trait implements PHP's magic __call method to intercept calls to methods when in object context that do not exist in the current class. If a macro with the given method name is found, it is evaluated and the result returned. If no...

Laravel Collection Public API: reject

reject($callback) The reject method used to create a new Collection instance containing all the items in the collection that do not pass a given truth test. The reject method only defines one parameter: $callback . The $callback function should...

Laravel 5: Performing HTTP Redirects With redirect

The redirect helper function is a useful helper function and makes the task of returning HTTP redirects much easier from controller actions or from routes. The $to parameter is defined with a default value of null . When $to is null , the redirect...

Filter Search