mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
fix case relation method has parameter
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