> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eloquentfiltering.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Modifiers

## Overview

Modifiers are ways to slightly alter the way that a filter works.

## How To Use

Append `:{modifierName}` to the `type` of the filter.

```php {2} theme={null}
$filter = [
    'type'   => '$like:start',
    'target' => 'framework',
    'value'  => 'laravel',
];
```

Multiple modifiers can be applied.

```php {2} theme={null}
$filter = [
    'type'   => '$like:start:end',
    'target' => 'framework',
    'value'  => 'laravel',
];
```

## Core Filter Modifiers

Some of the core filters provided by this package have modifiers.

`$like` [<Icon icon="link" iconType="solid" />](/v2/available-filters/field-filters/like#modifiers)

* `:start` - matches only the start of field `LIKE 'Laravel%'`.
* `:end`  - matches only the end of field `LIKE '%Laravel'`.

`$notLike` [<Icon icon="link" iconType="solid" />](/v2/available-filters/field-filters/not-like#modifiers)

* `:start` - matches only the start of field `NOT LIKE 'Laravel%'`.
* `:end` - matches only the end of field `NOT LIKE '%Laravel'`.

`$in` [<Icon icon="link" iconType="solid" />](/v2/available-filters/field-filters/in#modifiers)

* `:null` - also does a `or "{$target}" is null`.

`$notIn` [<Icon icon="link" iconType="solid" />](/v2/available-filters/field-filters/not-in#modifiers)

* `:null`- also does a `and "{$target}" is not null`.

## Configuring Modifiers

By default, all filter modifiers are enabled.

### Allowing

Though, you can specify only specific modifiers to enable.

```php theme={null}
public function allowedFilters(): AllowedFilterList
{
    return Filter::only(
        Filter::field('name', [FilterType::LIKE->withModifiers('end')])
    );
}
```

### Disabling

You can also disable all modifiers.

```php theme={null}
public function allowedFilters(): AllowedFilterList
{
    return Filter::only(
        Filter::field('name', [FilterType::LIKE->withoutModifiers()])
    );
}
```
