return eloquent builder instead of plain database builder from model methods (#521)

This commit is contained in:
Michael Tsang
2017-06-08 12:19:27 +02:00
committed by Barry vd. Heuvel
parent 7e78d02d0a
commit d6d99994c3
+2 -2
View File
@@ -383,7 +383,7 @@ class ModelsCommand extends Command
if ($this->write_model_magic_where) {
$this->setMethod(
Str::camel("where_" . $name),
'\Illuminate\Database\Query\Builder|\\' . get_class($model),
'\Illuminate\Database\Eloquent\Builder|\\' . get_class($model),
array('$value')
);
}
@@ -430,7 +430,7 @@ class ModelsCommand extends Command
$args = $this->getParameters($reflection);
//Remove the first ($query) argument
array_shift($args);
$this->setMethod($name, '\Illuminate\Database\Query\Builder|\\' . $reflection->class, $args);
$this->setMethod($name, '\Illuminate\Database\Eloquent\Builder|\\' . $reflection->class, $args);
}
} elseif (!method_exists('Illuminate\Database\Eloquent\Model', $method)
&& !Str::startsWith($method, 'get')