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

# Doesnt Has

export const type_0 = "$doesntHas"

## Definition

### Including Relations Fields

```php theme={null}
Filter::relation('comments', [FilterType::DOESNT_HAS])->includeRelationFields();
```

### With Defining Sub Filters

```php theme={null}
Filter::relation('comments', [FilterType::DOESNT_HAS],
    Filter::only(
        Filter::field('content', [FilterType::LIKE])
    )
);
```

## Array/Object Structure

<ParamField body="type" type="string" required>
  <code>
    {type_0}
  </code>
</ParamField>

<ParamField body="target" type="string" required />

<ParamField body="value" type="array" />

<ParamField body="value.*" type="array">
  Any other filter
</ParamField>

## Example

```php theme={null}
$filter = [
    'type'   => '$doesntHas',
    'target' => 'comments',
    'value'  => [
        [
            'type'   => '$like',
            'target' => 'content',
            'value'  => 'boring',
        ]
    ]
];
```

```php theme={null}
$sql = Project::filter([$filter])->toRawSql();
```

### SQL

```sql theme={null}
select
  *
from
  "projects"
where
  not exists (
    select
      *
    from
      "comments"
    where
      "projects"."id" = "comments"."project_id"
      and "comments"."content" LIKE '%boring%'
  )
```

## Modifiers

None available.
