From d2f1941edd19927156ec083fffbc9cd8c5dc7aca Mon Sep 17 00:00:00 2001 From: tiennt Date: Mon, 12 Jun 2023 20:34:41 +0700 Subject: [PATCH] fix: cant auto complete method chaining --- src/Console/ModelsCommand.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index d2d484ff5..b32ecc363 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -932,7 +932,19 @@ protected function createPhpDocs($class) continue; } $arguments = implode(', ', $method['arguments']); - $tagLine = "@method static {$method['type']} {$name}({$arguments})"; + + $staticMethodNames = [ + 'newQuery', + 'query', + 'newModelQuery', + ]; + + if (in_array($name, $staticMethodNames)) { + $tagLine = "@method static {$method['type']} {$name}({$arguments})"; + } else { + $tagLine = "@method {$method['type']} {$name}({$arguments})"; + } + if ($method['comment'] !== '') { $tagLine .= " {$method['comment']}"; }