Skip to content

Commit 46b4c71

Browse files
committed
fix: cant auto complete method chaining
1 parent 8eab699 commit 46b4c71

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Console/ModelsCommand.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,13 @@ protected function createPhpDocs($class)
932932
continue;
933933
}
934934
$arguments = implode(', ', $method['arguments']);
935-
$tagLine = "@method static {$method['type']} {$name}({$arguments})";
935+
936+
if (method_exists(\Illuminate\Database\Eloquent\Model::class, $name)) {
937+
$tagLine = "@method static {$method['type']} {$name}({$arguments})";
938+
} else {
939+
$tagLine = "@method {$method['type']} {$name}({$arguments})";
940+
}
941+
936942
if ($method['comment'] !== '') {
937943
$tagLine .= " {$method['comment']}";
938944
}

0 commit comments

Comments
 (0)