-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Methods such as orderBy, inRandomOrder, paginate, findOrFail etc. do not appear from Model #55867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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 |
Model forwards call to protected Eloquent Builder |
The project has no problem when running. |
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. |
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
The text was updated successfully, but these errors were encountered: