Showing 10 of 1,089 results.

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

Example Use | Laravel 5: Sorting Arrays With sort

…} 18 object ( StudentTestResult ) { 19 [ " name " ] " Alice " 20 [ " testScore " ] 95 21 } 22 object ( StudentTestResult ) { 23 [ " name " ] " Allison " 24 [ " testScore " ] 96 25 } 26 } Alternatively, we can sort the array based on the student's...

Filter Search