To define a new filter, extend the Waterhole\Filters\Filter class:
namespaceApp\Filters;
useIlluminate\Database\Eloquent\Builder;
useWaterhole\Filters\Filter;
classUnansweredextendsFilter{
/**
* The text label for the filter.
*/publicfunctionlabel(): string{
return'Unanswered';
}
/**
* Apply the filter to the feed query builder.
*/publicfunctionapply(Builder $query): void{
$query->where('is_answered', false);
}
}
Post filters need to be registered in order to make them available for selection when configuring a channel. To register a post filter, call the add method on the PostFilters extenders:
You're going a bit too fast! Take a break and try again in a moment.
Something went wrong! Please reload the page and try again.
Something Went Wrong
To pick up a sortable item, press space or enter. While dragging, use the arrow keys to move the item. Press space or enter again to drop the item in its new position, or press escape to cancel.