Methods such as orderBy, inRandomOrder, paginate, findOrFail etc. do not get suggested from Model #56780
Replies: 13 comments 10 replies
-
what happens if you ignore VS Code and actually try to run the code? i feel like this is really just an issue with intellisense rather than that the methods actually dont exist laravel historically hasnt played very nicely with IDEs and while there have been several plugins etc attempting to improve that that seems the most likely explanation to me here |
Beta Was this translation helpful? Give feedback.
-
Model forwards call to protected Eloquent Builder |
Beta Was this translation helpful? Give feedback.
-
The project has no problem when running. |
Beta Was this translation helpful? Give feedback.
-
Then you don't have to worry about this problem but I suggest you to use another IDE maybe phpstorm would be better option or I don't usually use VS Code and since you are getting this error maybe you need to configure it a bit. |
Beta Was this translation helpful? Give feedback.
-
I'm broke for PHPStorm. |
Beta Was this translation helpful? Give feedback.
-
@IgorArnaut this does not work for vs code? #55867 (comment) |
Beta Was this translation helpful? Give feedback.
-
VSCode might not come as optimized for PHP development, but its extensions can improve DevEx significantly: |
Beta Was this translation helpful? Give feedback.
-
I already have that extension.
This one too.
And this one too. |
Beta Was this translation helpful? Give feedback.
-
2025-06-02.16-53-31.mp4 |
Beta Was this translation helpful? Give feedback.
-
You can use https://github.com/barryvdh/laravel-ide-helper and the Model::query() method for autocomplete. Phpstorm or Cursor have a better auto completion IMHO |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
And? It works for you, doesn't work for me. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel Version
12.14.1
PHP Version
8.4.0
Database Driver & Version
No response
Description
I was watching this tutorial. https://www.youtube.com/playlist?list=PL4cUxeGkcC9gF5Gez17eHcDIxrpVSBuVt
I have written this Ninja model:
But when I type it's methods, methods


orderBy
,findOrFail
andpaginate
aren't recognizable in Laravel 12. They do not get suggestions in VS Code. I've checkedModel
class and these methods don't exist in it. I have the official Laravel extension and PHP Intelephense installed. I assume something has changed in Laravel 12.I've found a workaround to add method
query
after the Model name. It works forpaginate
,findOrFail
, but it doesn't work fororderBy
,inRandomOrder
etc.Steps To Reproduce
-mfs
)$ninja = Ninja::
in the controllerorderBy
Beta Was this translation helpful? Give feedback.
All reactions