---
description: Checking metadata is exist or checking specific keys.
---

# Has Metadata

## 🔥 `hasMetadata`

* Check if records of the relationship exist.
* regardless of whether the metadata content is empty or not.

```php
// Syntax
$model->hasMetadata(): bool
```



***



## 🔥 `hasMetadataById`

* Check if a metadata record exists by ID.
* &#x20;regardless of whether its metadata field contains data or not.

```php
// Syntax
$model->hasMetadataById(string $id): bool
```



***



## 🔥 `hasFilledMetadataById`

* Check if a metadata record exists by ID.
* Check if it contains non-empty data.

```php
// Syntax
$model->hasFilledMetadataById(string $id): bool
```

