You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Methods such as orderBy, inRandomOrder, paginate, findOrFail etc. do not appear from Model #55867
But when I type it's methods, methods orderBy, findOrFail and paginate aren't recognizable in Laravel 12. They do not get suggestions in VS Code. I've checked Model 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 for paginate, findOrFail, but it doesn't work for orderBy, inRandomOrder etc.
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 $query when the function is not found in model. You can use https://github.com/barryvdh/laravel-ide-helper for better autocomplete.
We always use Model::query()->... to have autocomplete and ctrl+click functionality.
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
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
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.
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
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.
Activity
robert-moore96 commentedon May 27, 2025
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
macropay-solutions commentedon May 27, 2025
Model forwards call to protected Eloquent Builder
$querywhen the function is not found in model. You can use https://github.com/barryvdh/laravel-ide-helper for better autocomplete.We always use Model::query()->... to have autocomplete and ctrl+click functionality.
IArnaut2 commentedon May 28, 2025
The project has no problem when running.
jaysindarov commentedon May 29, 2025
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.
IArnaut2 commentedon Jun 2, 2025
I'm broke for PHPStorm.
macropay-solutions commentedon Jun 2, 2025
@IgorArnaut this does not work for vs code? #55867 (comment)
shaedrich commentedon Jun 2, 2025
VSCode might not come as optimized for PHP development, but its extensions can improve DevEx significantly:
laravel.vscode-laravel(Official Laravel VSCode extension)bmewburn.vscode-intelephense-client(PHP Intelephense)ValeryanM.vscode-phpsab(PHP Sniffer & Beautifier)mohamedbenhida.laravel-intellisense(Laravel Intellisense)amiralizadeh9480.laravel-extra-intellisense(Laravel Extra Intellisense)IArnaut2 commentedon Jun 2, 2025
I already have that extension.
This one too.
And this one too.
IArnaut2 commentedon Jun 2, 2025
orderByDOES NOT APPEAR.2025-06-02.16-53-31.mp4
danielsum commentedon Jun 5, 2025
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
ghabriel25 commentedon Jun 6, 2025
@IgorArnaut
IArnaut2 commentedon Jun 6, 2025
And? It works for you, doesn't work for me.