Check on actual model, not facade

Fixes #311
This commit is contained in:
Barry vd. Heuvel
2016-03-03 09:45:00 +01:00
parent 83597196f9
commit f1ebd847aa
+1 -1
View File
@@ -334,7 +334,7 @@ class ModelsCommand extends Command
array_shift($args); array_shift($args);
$this->setMethod($name, '\Illuminate\Database\Query\Builder|\\' . $reflection->class, $args); $this->setMethod($name, '\Illuminate\Database\Query\Builder|\\' . $reflection->class, $args);
} }
} elseif (!method_exists('Eloquent', $method) && !Str::startsWith($method, 'get')) { } elseif (!method_exists('Illuminate\Database\Eloquent\Model', $method) && !Str::startsWith($method, 'get')) {
//Use reflection to inspect the code, based on Illuminate/Support/SerializableClosure.php //Use reflection to inspect the code, based on Illuminate/Support/SerializableClosure.php
$reflection = new \ReflectionMethod($model, $method); $reflection = new \ReflectionMethod($model, $method);