omaximus / laravel-pivot-polymorph
Fully polymorphic pivot relations for laravel eloquent
Installs: 26 321
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 4
Open Issues: 1
Requires
- php: >=7.1.3|^8.0
- illuminate/database: ~6.0|~7.0|~8.0
README
This package supports fully morph many-to-many relation.
Usage
Include trait \Pisochek\PivotPolymorph\Concerns\HasRelationships
to model.
Then like any other relation, write, for example:
return $this->morphsTo('parentName', 'relatedName', 'table');
Any your thoughts and corrections/extensions are much appreciated, functionality is not full yet.