Showing 10 of 1,278 results.

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

The getAttributes method simply returns an array containing all key/value pairs, representing the underlying data contained within the Fluent instance. After the following code is executed: 1 <?php 2 3 $ fluent = new Fluent ( $ testObject ) ; 4 5...

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

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

toJson($options = 0) | Laravel Fluent Part Two: The Public API

The toJson method will return a JSON encoded version of the data stored within the fluent instance. It internally does this by returning a call to PHP's json_encode function, passing in any $options that were supplied. Like the json_encode...

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