panakour/laravel-eloquent-relationships
Get laravel eloquent relations using reflection.
This will let you programmatically get the relations of models in laravel to use them how you want.
Examples
use EloquentRelationships\RelationMethods;
use EloquentRelationships\Relations;
$relations = new Relations(new YourModel());
//get all relations
$collection = $relations->all();
//or get relations by method
//belongsToMany
$collection = $relations->getByMethod(RelationMethods::BelongsToMany->value);
//MorphedByMany
$collection = $relations->getByMethod(RelationMethods::MorphedByMany->value);
Related Packages
shomisha/unusual-relationships
This package offers a trait which provides your models with the ability to have...
1,041
8
pindab0ter/constrained-morph-to-for-laravel
Constrained polymorphic relationships for Laravel Eloquent - limit morphTo relat...
12,178
3
a2zwebltd/auditable-relations
Automatic auditing for Eloquent relationship changes (attach, detach, sync) usin...
3,519
4
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v0.0.1 | ^8.1 | ^9.0| | MIT |