mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-19 10:33:11 +00:00
return eloquent builder instead of plain database builder from model methods (#521)
This commit is contained in:
committed by
Barry vd. Heuvel
parent
7e78d02d0a
commit
d6d99994c3
@@ -383,7 +383,7 @@ class ModelsCommand extends Command
|
|||||||
if ($this->write_model_magic_where) {
|
if ($this->write_model_magic_where) {
|
||||||
$this->setMethod(
|
$this->setMethod(
|
||||||
Str::camel("where_" . $name),
|
Str::camel("where_" . $name),
|
||||||
'\Illuminate\Database\Query\Builder|\\' . get_class($model),
|
'\Illuminate\Database\Eloquent\Builder|\\' . get_class($model),
|
||||||
array('$value')
|
array('$value')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -430,7 +430,7 @@ class ModelsCommand extends Command
|
|||||||
$args = $this->getParameters($reflection);
|
$args = $this->getParameters($reflection);
|
||||||
//Remove the first ($query) argument
|
//Remove the first ($query) argument
|
||||||
array_shift($args);
|
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)
|
} elseif (!method_exists('Illuminate\Database\Eloquent\Model', $method)
|
||||||
&& !Str::startsWith($method, 'get')
|
&& !Str::startsWith($method, 'get')
|
||||||
|
|||||||
Reference in New Issue
Block a user