class YourModel extends Model
{
protected $casts = [
'your_db_column_with_json' => 'array',
];
}
// usage:
$yourModel->your_db_column_with_json = [1,2,3];
$yourModel->save(); // now the array is automatically stored as json string in your database
$array = $yourModel->your_db_column_with_json;
// will return the array [1,2,3]
Forget about the whole json in your model. You just use array's from now on. The array is stored as json in your database but that is something you do not need to worry about.
So if you want to store meta data on your model you just do:
$yourModel->meta = ['first_name' => 'John', 'last_name' = 'Doe'];
$yourModel->save();
// and later on if you want to retrieve your meta data array
$yourModel->meta;
// or
$yourModel->meta['first_name']
// and
$yourModle->meta['last_name']