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);
-
Notifications
You must be signed in to change notification settings - Fork 0
panakour/laravel-eloquent-relationships
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
programmatically get and use laravel model relations
Resources
Stars
Watchers
Forks
Packages 0
No packages published