class FilterString extends Filter

Traits

Properties

Collection|array $filters

Collection of defined filters.

from  Filters
bool $has_filters from  Filters
bool $show_filters from  Filters
string $label from  Filter
string|null $column from  Filter
string|null $key from  Filter
mixed $input from  Filter
callable|null $queryCallback from  Filter
static protected $existingKeys from  Filter
string $type

Methods

void
setFilters()

Initialize filters.

from  Filters
string
getColumnKey(string $filter_label)

Identify the column key from a filter label.

from  Filters
void
updatedFilters(string $key, mixed $value)

Handle updates to filter inputs.

from  Filters
Collection
applyFilters(Collection $data)

Apply filters to the data collection (Array/Collection mode).

from  Filters
Collection
getFreshFilters()

Get a fresh instance of filters with current state merged.

from  Filters
Builder
applyFiltersToQuery(Builder $query)

Apply filters to the Eloquent query.

from  Filters
void
clearAllFilters(bool $selectAll = false)

Clear all active filters and search.

from  Filters
query(callable $callback)

Define a custom query callback for the filter.

from  Filter
__construct(string $label, string|null $index = null)

Create a new FilterString instance.

static Filter
make(string $label, string|null $index = null)

Static factory method.

Details

in Filters at line 35
void setFilters()

Initialize filters.

Processes defined filters, resolving keys, options (for magic-select), and serializing them for Livewire.

Return Value

void

in Filters at line 154
string getColumnKey(string $filter_label)

Identify the column key from a filter label.

Parameters

string $filter_label

Return Value

string

Exceptions

Exception

in Filters at line 174
void updatedFilters(string $key, mixed $value)

Handle updates to filter inputs.

Triggered by Livewire when filter properties change.

Parameters

string $key
mixed $value

Return Value

void

in Filters at line 219
Collection applyFilters(Collection $data)

Apply filters to the data collection (Array/Collection mode).

Parameters

Collection $data

Return Value

Collection

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).

Return Value

Collection

in Filters at line 317
Builder applyFiltersToQuery(Builder $query)

Apply filters to the Eloquent query.

Parameters

Builder $query

Return Value

Builder

in Filters at line 416
void clearAllFilters(bool $selectAll = false)

Clear all active filters and search.

Parameters

bool $selectAll

Whether to select all data after clearing.

Return Value

void

in Filter at line 44
Filter query(callable $callback)

Define a custom query callback for the filter.

Parameters

callable $callback

Return Value

Filter

at line 24
__construct(string $label, string|null $index = null)

Create a new FilterString instance.

Parameters

string $label
string|null $index

at line 36
static Filter make(string $label, string|null $index = null)

Static factory method.

Parameters

string $label
string|null $index

Return Value

Filter