Showing 10 of 1,214 results.

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

If we look at the following code example, one might be tempted to say that the value of $message would be Hello, world! , but that would be incorrect: 1 <?php 2 3 $ testObject = new stdClass ; 4 $ testObject -> method = function ( ) { 5 return '...

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

Filter Search