From d6d99994c3e20b9fd5edea2705b7d0114f46909a Mon Sep 17 00:00:00 2001 From: Michael Tsang Date: Thu, 8 Jun 2017 18:19:27 +0800 Subject: [PATCH] return eloquent builder instead of plain database builder from model methods (#521) --- src/Console/ModelsCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index 83e8836..abcdbf2 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -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')