The eloqrait
package provides Laravel Eloquent traits for defining various types of model relations.
You can install the package via composer:
composer require kwidoo/eloqrait
php artisan eloqrait <relation_type> <first_model_name> <second_model_name> --reverse --namespace=<namespace> --model_namespace=<model_namespace>
The available relation types are hasmany
, belongsto
, and belongstomany
. The --reverse
option can be used to generate a reverse relation trait. You can also specify a custom namespace for the generated code and the model namespace.
For more information on using the generated traits, please refer to the Laravel Eloquent documentation.
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.