We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When executing queries on Statamic content repositories, tools like PHP Intelephense and Larastan report errors like Undefined method ‘where’.
Undefined method ‘where’
The code above works, but quality checks and autocomplete do not. Is there a reason for this? Is it intentional?
Some examples from a fresh Statamic installation:
Entry::query()->where('collection', 'pages')->get(); Entry::query()->orderBy('updated_at', 'desc')->limit(10)->get(); User::current()->can('view pages entries');
The where(), orderBy() and can() methods are marked as undefined.
No response
Environment Application Name: Statamic Laravel Version: 10.48.9 PHP Version: 8.2.18 Composer Version: 2.7.1 Environment: local Debug Mode: ENABLED URL: test.test Maintenance Mode: OFF Cache Config: NOT CACHED Events: NOT CACHED Routes: NOT CACHED Views: NOT CACHED Drivers Broadcasting: log Cache: statamic Database: mysql Logs: stack / single Mail: smtp Queue: sync Session: file Statamic Addons: 0 Antlers: runtime Sites: 1 Stache Watcher: Enabled Static Caching: Disabled Version: 4.57.2 Solo
Fresh statamic/statamic site via CLI
None
The text was updated successfully, but these errors were encountered:
This will likely be because most of our interfaces are empty or don't include all of the methods, like this one.
We can fix this by adding the methods to the interfaces.
Sorry, something went wrong.
Yea, makes sense. It's not really an issue but a improvement suggestion. Being able to use tools like PHPStan would definitely be very nice.
I've moved this to the statamic/ideas repository since this is more of a feature request/improvement, than a bug.
statamic/ideas
No branches or pull requests
Bug description
When executing queries on Statamic content repositories, tools like PHP Intelephense and Larastan report errors like
Undefined method ‘where’
.The code above works, but quality checks and autocomplete do not.
Is there a reason for this? Is it intentional?
How to reproduce
Some examples from a fresh Statamic installation:
The where(), orderBy() and can() methods are marked as undefined.
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
None
Additional details
No response
The text was updated successfully, but these errors were encountered: