mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 18:13:11 +00:00
Merge pull request #632 from JeppeKnockaert/feature/add-morphedByMany-relation
Add morphedByMany relationship
This commit is contained in:
@@ -461,7 +461,8 @@ class ModelsCommand extends Command
|
||||
'morphOne',
|
||||
'morphTo',
|
||||
'morphMany',
|
||||
'morphToMany'
|
||||
'morphToMany',
|
||||
'morphedByMany'
|
||||
) as $relation) {
|
||||
$search = '$this->' . $relation . '(';
|
||||
if ($pos = stripos($code, $search)) {
|
||||
@@ -471,7 +472,14 @@ class ModelsCommand extends Command
|
||||
if ($relationObj instanceof Relation) {
|
||||
$relatedModel = '\\' . get_class($relationObj->getRelated());
|
||||
|
||||
$relations = ['hasManyThrough', 'belongsToMany', 'hasMany', 'morphMany', 'morphToMany'];
|
||||
$relations = [
|
||||
'hasManyThrough',
|
||||
'belongsToMany',
|
||||
'hasMany',
|
||||
'morphMany',
|
||||
'morphToMany',
|
||||
'morphedByMany',
|
||||
];
|
||||
if (in_array($relation, $relations)) {
|
||||
//Collection or array of models (because Collection is Arrayable)
|
||||
$this->setProperty(
|
||||
|
||||
Reference in New Issue
Block a user