class BasicFilter extends TwillBaseFilter (View source)

Constants

OPTION_ALL

Properties

protected string|null $label from  TwillBaseFilter
protected string|null $queryString from  TwillBaseFilter
protected bool $enabled from  TwillBaseFilter
protected Closure|null $apply from  TwillBaseFilter
protected Collection|null $options
protected mixed $appliedValue
protected bool $includeAll
protected mixed $default

Methods

Builder
applyFilter(Builder $builder)

No description

__construct()

No description

static TwillBaseFilter
make()

No description

label(string $label)

Set a label to use for the filter.

string|null
getLabel()

No description

queryString(string $queryString)

Set the query string to use in the url

string
getQueryString()

No description

onlyEnableWhen(bool $enable = true)

When passing a boolean, the filter will only be enabled when it is true.

disable(bool $disable = true)

When passing a boolean, the filter will be disabled when it is true.

apply(Closure $closure)

The closure to apply the filter.

bool
isEnabled()

No description

withFilterValue(mixed $value)

Sets the applied value of the filter.

withoutIncludeAll(bool $removeIncludeAll = true)

This removes the "All" option.

options(Collection $options)

Sets the options that can be used to select, it should be a key->value collection.

default(mixed $default)

Set the default value of the filter.

mixed
getDefaultValue()

No description

string
getKey()

No description

Collection
getOptions(ModuleRepository $repository)

No description

Details

Builder applyFilter(Builder $builder)

No description

Parameters

Builder $builder

Return Value

Builder

final __construct()

No description

static TwillBaseFilter make()

No description

Return Value

TwillBaseFilter

TwillBaseFilter label(string $label)

Set a label to use for the filter.

Parameters

string $label

Return Value

TwillBaseFilter

string|null getLabel()

No description

Return Value

string|null

TwillBaseFilter queryString(string $queryString)

Set the query string to use in the url

Parameters

string $queryString

Return Value

TwillBaseFilter

string getQueryString()

No description

Return Value

string

TwillBaseFilter onlyEnableWhen(bool $enable = true)

When passing a boolean, the filter will only be enabled when it is true.

Parameters

bool $enable

Return Value

TwillBaseFilter

TwillBaseFilter disable(bool $disable = true)

When passing a boolean, the filter will be disabled when it is true.

Parameters

bool $disable

Return Value

TwillBaseFilter

TwillBaseFilter apply(Closure $closure)

The closure to apply the filter.

Parameters

Closure $closure

Return Value

TwillBaseFilter

bool isEnabled()

No description

Return Value

bool

BasicFilter withFilterValue(mixed $value)

Sets the applied value of the filter.

This is usually something you do not want to run manually.

Parameters

mixed $value

Return Value

BasicFilter

BasicFilter withoutIncludeAll(bool $removeIncludeAll = true)

This removes the "All" option.

Parameters

bool $removeIncludeAll

Return Value

BasicFilter

BasicFilter options(Collection $options)

Sets the options that can be used to select, it should be a key->value collection.

Parameters

Collection $options

Return Value

BasicFilter

BasicFilter default(mixed $default)

Set the default value of the filter.

Parameters

mixed $default

Return Value

BasicFilter

mixed getDefaultValue()

No description

Return Value

mixed

string getKey()

No description

Return Value

string

Collection getOptions(ModuleRepository $repository)

No description

Parameters

ModuleRepository $repository

Return Value

Collection