Filter
class Filter
Traits
Properties
| Collection|array | $filters | Collection of defined filters. |
from Filters |
| bool | $has_filters | from Filters | |
| bool | $show_filters | from Filters | |
| string | $label | ||
| string|null | $column | ||
| string|null | $key | ||
| mixed | $input | ||
| callable|null | $queryCallback | ||
| static protected | $existingKeys |
Methods
Apply filters to the data collection (Array/Collection mode).
Get a fresh instance of filters with current state merged.
No description
Details
in
Filters at line 35
void
setFilters()
Initialize filters.
Processes defined filters, resolving keys, options (for magic-select), and serializing them for Livewire.
in
Filters at line 154
string
getColumnKey(string $filter_label)
Identify the column key from a filter label.
in
Filters at line 174
void
updatedFilters(string $key, mixed $value)
Handle updates to filter inputs.
Triggered by Livewire when filter properties change.
in
Filters at line 219
Collection
applyFilters(Collection $data)
Apply filters to the data collection (Array/Collection mode).
in
Filters at line 276
Collection
getFreshFilters()
Get a fresh instance of filters with current state merged.
Re-initializes filters (e.g. to get closures back) and merges the Livewire state (inputs).
in
Filters at line 317
Builder
applyFiltersToQuery(Builder $query)
Apply filters to the Eloquent query.
in
Filters at line 416
void
clearAllFilters(bool $selectAll = false)
Clear all active filters and search.
at line 44
Filter
query(callable $callback)
Define a custom query callback for the filter.
at line 52
__construct(string $label, string|null $column = null)
No description