πŸͺ­Update Metadata

πŸ”₯ updateMetadataById

// Syntax
$model->updateMetadataById(string $id, array|Collection $metadata): bool

Example Usage

$company->createMetadata(['theme' => 'dark']);
$company->updateMetadataById($id, ['theme' => 'light']);

// Using array
$company->updateMetadataById($id, ['theme' => 'auto', 'year' => 1997]);
// The updated metadata will be:
[
    'theme' => 'auto',
    'year' => 1997,
];


// Using Collection
$company->updateMetadataById($id, collect(['theme' => 'dark', 'year' => 1998]));
// The updated metadata will be:
[
    'theme' => 'dark',
    'year' => 1998,
];
Parameters
Data Types

id

string

metadata

array, Collection

Return Type β‡’ Boolean


πŸ”₯ updateKeysMetadataById

Example Usage

Parameters
Data Types

id

string

keys

array, Collection, string, int, null

value

array, Collection, string, int, float, bool, null

Return Type β‡’ Boolean


πŸ”₯ updateKeyMetadataById

Example usage

Parameters
Data Types

id

string

key

string, int, null

value

array, Collection, string, int, float, bool, null

Return Type β‡’ Boolean

Last updated