βœ…Has Metadata

Checking metadata is exist or checking specific keys.

πŸ”₯ hasMetadata

  • Check if a record of the relationship exists.

  • regardless of whether the metadata content is empty or not.

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


πŸ”₯ hasFilledMetadata

  • Check if a record of the relationship exists.

  • Check metadata column contains data that is not empty

// Syntax
$model->hasFilledMetadata(): bool


πŸ”₯ hasKeyMetadata

  • Check if the metadata contains a specific key.

  • regardless of whether the key content is empty.


πŸ”₯ hasAllKeysMetadata

  • Check if the metadata contains all specified keys.

  • regardless of whether all keys content is empty.


πŸ”₯ hasAnyKeysMetadata

  • Check if metadata contains any of the specified keys.

  • regardless of whether all keys content is empty.


🐞 Examples


πŸ“š Summary

  • hasAllKeysMetadata() - Returns true only if ALL specified keys exist

  • hasKeyMetadata() - Convenience method for checking a single key, internally uses hasAllKeysMetadata()

  • hasAnyKeysMetadata() - Returns true if ANY of the specified keys exist

Last updated