Skip to content

Commit

Permalink
fix meta value cast
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Jan 2, 2024
1 parent d024d61 commit 9202366
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Casts/MetaValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MetaValue implements CastsAttributes
*/
public function get(Model $model, string $key, mixed $value, array $attributes): mixed
{
return json_decode($value, true) ?? $value;
return is_null($value) ? $value : (json_decode($value, true) ?? $value);
}

/**
Expand Down

0 comments on commit 9202366

Please sign in to comment.