Local Query Scope Support [FEATURE REQUEST]
Please add support for Laravel's local query scope methods, so that Eloquent methods can be suggested after it. Relevant link
Thank you for the suggestion!
We should already do that:
Is there anything specific where it doesn't work? Is it Laravel >= 9? Do all the methods have a correct mouse hover?
@jakubmisek Hello.
About scopes, in Laravel 12, we have a new attribute to define a function as local scope: #[Scope]..
You can see the documentation here Laravel Local Scopes.
The extension doesn't recognize the function as a scope. And asks for the Builder parameter.
Also we have another attribute to identify a Model as scoped: #[ScopedBy([AncientScope::class])].
Can you add support for this?
Thank you @trollfalgar - will be added!
@trollfalgar does the scoped model have some extra IntelliSense?
I.e. all the local scope methods from the "AncientScope" should be listed as a member of User ?
@trollfalgar does the scoped model have some extra IntelliSense?
I.e. all the local scope methods from the "AncientScope" should be listed as a member of User ?
@jakubmisek in global scopes, like the exemple #[ScopedBy([AncientScope::class])] (Or the old way to do it), the only method needed is apply(), and automatically the scope is always applied. So I don't think any method should be listed in IntelliSense.
In local scopes, yes, should keep listing the method name, recognizing the parameters (ignoring the dependency injection Builder.
Hello, @jakubmisek, any news about this? 🙏
@trollfalgar thanks for reminding me, yes, support for the #[Scope] attribute has been implemented - already in the pre-release (with a few fixes in the next pre-release)