belongsTo(CustomField::class); } public function item() { return $this->belongsTo(Item::class, 'item_id'); } public function getValueAttribute($value) { try { return array_values(json_decode($value, true, 512, JSON_THROW_ON_ERROR)); } catch (JsonException) { return $value; } } }