Converting the Object to JSON With toJson | Laravel 5 Fluent API: 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...