mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-17 17:47:13 +00:00
Merge pull request #350 from Kurre/hasManyThrough-relationship
Add hasManyThrough relationship
This commit is contained in:
@@ -353,6 +353,7 @@ class ModelsCommand extends Command
|
|||||||
|
|
||||||
foreach (array(
|
foreach (array(
|
||||||
'hasMany',
|
'hasMany',
|
||||||
|
'hasManyThrough',
|
||||||
'belongsToMany',
|
'belongsToMany',
|
||||||
'hasOne',
|
'hasOne',
|
||||||
'belongsTo',
|
'belongsTo',
|
||||||
@@ -370,7 +371,7 @@ class ModelsCommand extends Command
|
|||||||
if ($relationObj instanceof Relation) {
|
if ($relationObj instanceof Relation) {
|
||||||
$relatedModel = '\\' . get_class($relationObj->getRelated());
|
$relatedModel = '\\' . get_class($relationObj->getRelated());
|
||||||
|
|
||||||
if (in_array($relation, ['belongsToMany', 'hasMany', 'morphMany', 'morphToMany'])) {
|
if (in_array($relation, ['hasManyThrough', 'belongsToMany', 'hasMany', 'morphMany', 'morphToMany'])) {
|
||||||
//Collection or array of models (because Collection is Arrayable)
|
//Collection or array of models (because Collection is Arrayable)
|
||||||
$this->setProperty(
|
$this->setProperty(
|
||||||
$method,
|
$method,
|
||||||
|
|||||||
Reference in New Issue
Block a user