From 46b4c7179c104a87aa7ca12856f6f9829277acee 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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index d2d484ff5..113816ad7 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -932,7 +932,13 @@ protected function createPhpDocs($class) continue; } $arguments = implode(', ', $method['arguments']); - $tagLine = "@method static {$method['type']} {$name}({$arguments})"; + + if (method_exists(\Illuminate\Database\Eloquent\Model::class, $name)) { + $tagLine = "@method static {$method['type']} {$name}({$arguments})"; + } else { + $tagLine = "@method {$method['type']} {$name}({$arguments})"; + } + if ($method['comment'] !== '') { $tagLine .= " {$method['comment']}"; }