https://github.com/nilportugues/serializer-eloquent-driver
Driver for the Serializer library caring of Eloquent ORM model serialization
https://github.com/nilportugues/serializer-eloquent-driver
driver eloquent-orm-models serializer
Last synced: over 1 year ago
JSON representation
Driver for the Serializer library caring of Eloquent ORM model serialization
- Host: GitHub
- URL: https://github.com/nilportugues/serializer-eloquent-driver
- Owner: nilportugues
- License: mit
- Created: 2015-11-21T14:41:07.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-30T08:24:38.000Z (about 9 years ago)
- Last Synced: 2025-03-05T15:05:55.034Z (over 1 year ago)
- Topics: driver, eloquent-orm-models, serializer
- Language: PHP
- Homepage: http://nilportugues.com
- Size: 35.2 KB
- Stars: 4
- Watchers: 3
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Serializer Driver for Eloquent ORM Models
[](https://travis-ci.org/nilportugues/serializer-eloquent-driver)
[](https://scrutinizer-ci.com/g/nilportugues/serializer-eloquent-driver/?branch=master) [](https://insight.sensiolabs.com/projects/497f9e58-e979-453e-bc04-b1501b88d027)
[](https://packagist.org/packages/nilportugues/serializer-eloquent)
[](https://packagist.org/packages/nilportugues/serializer-eloquent)
[](https://packagist.org/packages/nilportugues/serializer-eloquent)
[](https://paypal.me/nilportugues)
## What?
This is a driver for the [Serializer](https://github.com/nilportugues/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](https://github.com/nilportugues/serializer) in a single library.
## Installation
Use [Composer](https://getcomposer.org) to install the package:
```json
$ composer require nilportugues/serializer-eloquent
```
## Usage
This will return an array following the [Serializer](https://github.com/nilportugues/serializer) format.
```php
use NilPortugues\Serializer\Drivers\Eloquent\EloquentDriver;
$serialized = EloquentDriver::serialize($value);
```
## Todo
Code all examples provided in the Eloquent documentation for relationships as tests:
- [X] One To One
- [X] One To Many
- [X] 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](https://github.com/nilportugues/serializer-eloquent-driver/issues/new).
* You can grab the source code at the package's [Git repository](https://github.com/nilportugues/serializer-eloquent-driver).
## Support
Get in touch with me using one of the following means:
- Emailing me at
- Opening an [Issue](https://github.com/nilportugues/serializer-eloquent-driver/issues/new)
## Authors
* [Nil Portugués Calderó](http://nilportugues.com)
* [The Community Contributors](https://github.com/nilportugues/serializer-eloquent-driver/graphs/contributors)
## License
The code base is licensed under the [MIT license](LICENSE).