8000 GitHub - panakour/laravel-eloquent-relationships: programmatically get and use laravel model relations
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

panakour/laravel-eloquent-relationships

Repository files navigation

Get laravel eloquent relations using reflection.

tests Code Coverage Badge Total Downloads

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);

About

programmatically get and use laravel model relations

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages

0