'array', 'description' => 'array', 'isActive' => 'boolean', ]; public function getTitleAttribute($value) { $locale = app()->getLocale(); $titles = is_array($value) ? $value : json_decode($value, true); return $titles[$locale] ?? $titles['en'] ?? ''; } public function getDescriptionAttribute($value) { $locale = app()->getLocale(); $descriptions = is_array($value) ? $value : json_decode($value, true); return $descriptions[$locale] ?? $descriptions['en'] ?? ''; } public function setTitleAttribute($value) { $this->attributes['title'] = json_encode($value); } public function setDescriptionAttribute($value) { $this->attributes['description'] = json_encode($value); } public function menus() { return $this->hasMany(Menu::class); } }