nilportugues/serializer-eloquent
Eloquent Driver for NilPortugues Serializer outputting valid API responses in JSON, JSON API and HAL+JSON API formats.
36,643
5
| Install | |
|---|---|
composer require nilportugues/serializer-eloquent |
|
| Latest Version: | 1.0.12 |
| PHP: | >=5.5.0 |
| Laravel: | 5 |
| License: | MIT |
| Last Updated: | Mar 30, 2017 |
| Links: | GitHub · Packagist |
Maintainer: nilportugues
Serializer Driver for Eloquent ORM Models
What?
This is a driver for the Serializer library caring of Eloquent ORM model serialization.
Why?
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.
Installation
Use Composer to install the package:
$ composer require nilportugues/serializer-eloquent
Usage
This will return an array following the Serializer format.
use NilPortugues\Serializer\Drivers\Eloquent\EloquentDriver;
$serialized = EloquentDriver::serialize($value);
Todo
Code all examples provided in the Eloquent documentation for relationships as tests:
- One To One
- One To Many
- Has Many Through
- Polymorphic Relations
- Many To Many
- Many To Many Polymorphic Relations
Contribute
Contributions to the package are always welcome!
- Report any bugs or issues you find on the issue tracker.
- You can grab the source code at the package's Git repository.
Support
Get in touch with me using one of the following means:
- Emailing me at contact@nilportugues.com
- Opening an Issue
Authors
License
The code base is licensed under the MIT license.
Related Packages
nilportugues/laravel5-json-api-dingo
Laravel5 JSONAPI and Dingo together to build APIs fast
1,498
30
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 1.0.12 | >=5.5.0 | ^5.1 | MIT | |
| 1.0.11 | >=5.5.0 | ^5.1 | MIT | |
| 1.0.10 | >=5.5.0 | ^5.1 | MIT | |
| 1.0.9 | >=5.5.0 | ^5.1 | MIT | |
| 1.0.8 | >=5.5.0 | ^5.1 | MIT | |
| 1.0.7 | >=5.5.0 | ^5.1 | MIT | |
| 1.0.6 | >=5.5.0 | ^5.1 | MIT | |
| 1.0.5 | >=5.5.0 | 5.1.* | MIT | |
| 1.0.4 | >=5.5.0 | ^5.1 | MIT | |
| 1.0.3 | >=5.5.0 | ^5.1 | MIT | |
| 1.0.2 | >=5.5.0 | ^5.1 | MIT | |
| 1.0.1 | >=5.5.0 | ^5.1 | MIT | |
| 1.0.0 | >=5.5.0 | ^5.1 | MIT |


