Eloquent Driver for NilPortugues Serializer outputting valid API responses in JSON, JSON API and HAL+JSON API formats.
nilportugues/serializer-eloquent is a Laravel package for eloquent driver for nilportugues serializer outputting valid api responses in json, json api and hal+json api formats..
It currently has 5 GitHub stars and 36.588 downloads on Packagist (latest version 1.0.12).
Install it with composer require nilportugues/serializer-eloquent.
Discover more Laravel packages by nilportugues
or browse all Laravel packages to compare alternatives.
Last updated
This is a driver for the Serializer library caring of Eloquent ORM model serialization.
Due to the popularity of Eloquent, specially in Laravel apps, a driver has been develop to unite all Eloquent serialization edge-cases for Serializer in a single library.
Use Composer to install the package:
$ composer require nilportugues/serializer-eloquent
This will return an array following the Serializer format.
use NilPortugues\Serializer\Drivers\Eloquent\EloquentDriver;
$serialized = EloquentDriver::serialize($value);
Code all examples provided in the Eloquent documentation for relationships as tests:
Contributions to the package are always welcome!
Get in touch with me using one of the following means:
The code base is licensed under the MIT license.