Skip to content

Support Query Scope classes #207

@caugner

Description

@caugner

Is your feature request related to a problem? Please describe.

Query Scope classes can be created using make:scope as an alternative to creating "local" scopes inside the Model class directly. The Scope interface has an apply() method that takes two parameters, Builder $builder and Model $model and these can not be overwritten in a Scope implementation, as this causes Psalm to emit a MoreSpecifciImplementedParamType error.

Describe the solution you'd like
The Scope interface should be extended with a @template TModel of Model, so that the apply() parameters can be typed as @param Builder<TModel> $builder and @param TModel $model respectively.

Describe alternatives you've considered
(None.)

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions