Showing 10 of 1,090 results.

Laravel 5: Getting Specific Messages With get

…messages for a given $key with the specified $format . The $format is null by default, which will cause the get method to use the format stored within the MessageBag instance (which can be retrieved using the getFormat method). Alternatively,...

Laravel ViewErrorBag Public API: put

…ageBagCount = count ( $ viewErrorBag -> getBags ( ) ) ; After the above code has executed, the $messageBagCount variable would contain the value 1 . Another way to add MessageBag instances to the ViewErrorBag is by dynamically setting an instance...

Laravel Collection Public API: zip

zip($items) The zip method is used to merge the values of the $items array with the values within the Collection at the corresponding index. The zip method produces results that are similar to Python's zip function, and developer's coming from a...

Fluent and Closures | Laravel Fluent Part Two: The Public API

…as the above example, the closure instance is stored as the value. The following code will quickly prove this: 1 <?php 2 3 // true 4 $ isClosure = ( $ fluent -> method instanceof Closure ) : To evaluate the closure and get the results, the value...

jsonSerialize() | Laravel Fluent Part Two: The Public API

…e jsonSerialize method internally returns a call to toArray . Because of this, toArray , jsonSerialize and getAttributes are all functionally equivalent. The jsonSerialize method exists to satisfy PHP's JsonSerializable interface, which allows...

sortBy Options | Laravel Collection Public API: sortBy

The $options parameter allows developers to change the sorting behavior of the sortBy method. The accepted options are the same options that are defined for PHP's sort function. The following collection instance will be used throughout this...

Filter Search