Automatically append accessors to model serialization
Eloquent Auto Append automatically appends your accessors to model serialization without having you to explicitly specify them in the
- How to always append attributes to Laravel Eloquent model?
- Why is my Laravel Eloquent accessor not showing up in the response?
The recommended way to install Eloquent Auto Append is through Composer
$ composer require awobaz/eloquent-auto-append
Note: Eloquent Auto Append requires Laravel 5.4+.
Simply make your model class derive from the
Awobaz\AutoAppend\Database\Eloquent\Model base class. The
Awobaz\AutoAppend\Database\Eloquent\Model extends the
Eloquent base class without changing its core functionality.
If for some reasons you can't derive your models from
Awobaz\AutoAppend\Database\Eloquent\Model, you may take advantage of the
Awobaz\AutoAppend\AutoAppend trait. Simply use the trait in your models.
You may disable Auto Append on a model by setting it's property
protected $autoAppend = false;
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.
In order to run the test suite, install the development dependencies:
$ composer install --dev
Then, run the following command:
- Claudin J. Daniel - Initial work
- Awobaz - Web/Mobile agency based in Montreal, Canada
Eloquent Auto Append is licensed under the MIT License.