mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-17 17:47:13 +00:00
Merge pull request #664 from huydang284/master
ide-helper:models error when model's method has parameters and also has relation
This commit is contained in:
@@ -476,6 +476,11 @@ class ModelsCommand extends Command
|
||||
$search = '$this->' . $relation . '(';
|
||||
if ($pos = stripos($code, $search)) {
|
||||
//Resolve the relation's model to a Relation object.
|
||||
$methodReflection = new \ReflectionMethod($model, $method);
|
||||
if ($methodReflection->getNumberOfParameters()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$relationObj = $model->$method();
|
||||
|
||||
if ($relationObj instanceof Relation) {
|
||||
|
||||
Reference in New Issue
Block a user