Showing 10 of 1,090 results.

Step 1.4 More Methods | Semantic UI Paginator for Laravel 4

…links. For the Semantic paginator, we are going to use the ellipsis horizontal icon the framework provides: 1 /** 2 * Get a pagination "dot" element. 3 * 4 * @return string 5 */ 6 public function getDots ( ) 7 { 8 return $ this ->...

Example Use | Laravel 5: Filtering Array Elements With only

The only helper method is the logical opposite of the except method. Using the same $_POST array from the previous example, we could retrieve only a user's first name like so: 1 use Illuminate \ Support \ Arr ; 2 3 $ inputData = Arr :: only ( 4 $...

Laravel Collection Public API: reduce

…turns 0 which might not seem obvious when the expected answer is 120 . However, the $initial is used as the $carry argument for the first iteration of the $callback function. The $initial value is null by default. When null is used for...

Laravel 5: Retrieving Elements from an Array With get

The get helper method will retrieve an item from the given $array using dot notation. This allows developers to retrieve items from the array at arbitrary depths quickly, without having to use PHP's array syntax.

Laravel 5: Getting the First Element of an Array With head

The head is a simple wrapper around PHP's reset function. This function will return the first element of an array or false if the array is empty. This function does not modify the array.The signature of the head helper function is: 1 function head...

Laravel Collection Public API: prepend

…string 'XL' (length=2) The following examples demonstrate the usage of the prepend method when supplying an argument for the $key parameter: 1 <?php 2 3 // Create a new collection to work with. 4 $ collection = collect ( [ 5 ' name ' => ' Holiday...

Filter Search