Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds support for basic class based filters. This means you can extract a filter into a reusable class that could be applied to multiple resources.
Here's what the class looks like:
The
Filter
class now has asetUp()
method that can be used by class-based filters to set some default arguments. The$name
parameter for::make()
and__construct()
is also now nullable so class-based filters don't need to provide it but they still can if they don't want to define the name as$name
or using$this->name()
insetUp()
.This pull request also opens up the scope for future enhancements, such as parameter based filters where you could define the fields for the filter / options inside of a class.
A good example of a reusable filter is a
ActiveFilter
where multiple resources have a common column and column values.