mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
Add ::query support
This commit is contained in:
@@ -409,6 +409,7 @@ class ModelsCommand extends Command
|
|||||||
protected function getPropertiesFromMethods($model)
|
protected function getPropertiesFromMethods($model)
|
||||||
{
|
{
|
||||||
$methods = get_class_methods($model);
|
$methods = get_class_methods($model);
|
||||||
|
|
||||||
if ($methods) {
|
if ($methods) {
|
||||||
sort($methods);
|
sort($methods);
|
||||||
foreach ($methods as $method) {
|
foreach ($methods as $method) {
|
||||||
@@ -444,6 +445,9 @@ class ModelsCommand extends Command
|
|||||||
array_shift($args);
|
array_shift($args);
|
||||||
$this->setMethod($name, '\Illuminate\Database\Eloquent\Builder|\\' . $reflection->class, $args);
|
$this->setMethod($name, '\Illuminate\Database\Eloquent\Builder|\\' . $reflection->class, $args);
|
||||||
}
|
}
|
||||||
|
} elseif (in_array($method, ['query', 'newQuery', 'newModelQuery'])) {
|
||||||
|
$reflection = new \ReflectionClass($model);
|
||||||
|
$this->setMethod($method, '\Illuminate\Database\Eloquent\Builder|\\' . $reflection->getName());
|
||||||
} 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