☂️Sync Metadata

Synchronize metadata for the model.

🔥 syncMetadata

  • If metadata already exists, it will be updated.

  • If it doesn't exist, a new metadata record will be created.

// Syntax
$model->syncMetadata(array|Collection $metadata): bool

Example Usage


// Using an array
$model->syncMetadata(['theme' => 'dark', 'views' => 767]);

// Using Collection
$model->syncMetadata(collect(['theme' => 'dark', 'views' => 767]));
Parameters
Data Type

metadata

array, Collection

Return Type ⇒ Boolean

Last updated