Showing 10 of 1,090 results.

Laravel Collection Public API: jsonSerialize

jsonSerialize The jsonSeralize method internally returns the value of the toArray method. This method exists to implement PHP's JsonSerializable interface, which allows developers to customize how a class is represented when using the json_encode...

Laravel MessageBag Public API: first

…ll the first method will return the first message in the MessageBag instance. If there are no messages stored within the message bag, the first method will return an empty string. The first method also accepts a $format parameter, which allows...

Laravel Collection Public API: slice

…ction and would contain a value similar to the following output: 1 object(Illuminate\Support\Collection)[134] 2 protected 'items' => 3 array (size=5) 4 0 => int 4 5 1 => int 5 6 2 => int 6 7 3 => int 7 8 4 => int 8 The $length parameter allows...

Laravel: Calling Artisan Commands From Your Application

…ll and Artisan command from within your application and 6 // pass an argument. 7 Artisan :: call ( ' migrate ' , array ( ' --path ' => ' ../app/database/migrations ' ) ) ; 8 } ) ; You could even simplify this further by leveraging Laravel's >path...

Laravel 5: Sorting Arrays With sort

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 into the $callback function. It then...

Filter Search