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

export const type_0 = "$doesntHasMorph"

## Definition

```php theme={null}
Filter::morphRelation('imageable', [FilterType::DOESNT_HAS_MORPH],
    Filter::morphType('*'),
);
```

<Note>
  [See Morph Relation In Detail](/v2/basics/in-detail#morph-relation)
</Note>

## Array/Object Structure

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

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

<ParamField body="types" type="array,min:1" required />

<ParamField body="types.*.type" type="string" required />

<ParamField body="types.*.value" type="array" />

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

## Example

```php theme={null}
$filter = [
    'target' => 'imageable',
    'type'   => '$doesntHasMorph',
    'types'  => [
        [
            'type'  => '*',
            'value' => [],
        ],
    ],
];
```

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

### SQL

```sql theme={null}
SELECT *
FROM "images"
WHERE (
		(
			"images"."imageable_type" = 'articles'
			AND NOT EXISTS (
				SELECT *
				FROM "articles"
				WHERE "images"."imageable_id" = "articles"."id"
				)
			)
		OR (
			"images"."imageable_type" = 'user_profiles'
			AND NOT EXISTS (
				SELECT *
				FROM "user_profiles"
				WHERE "images"."imageable_id" = "user_profiles"."id"
				)
			)
		)
```

## Modifiers

None available.
