translatable = ['name']; $this->appends = ['translateName']; } } public static function boot() { parent::boot(); self::created(function ($model) { Cache::forget('footerWidget'); }); self::updated(function ($model) { Cache::forget('footerWidget'); }); self::deleted(function($model){ Cache::forget('footerWidget'); }); } public function pageData(){ return $this->belongsTo(DynamicPage::class,'page', 'id'); } public function getTranslateNameAttribute(){ return $this->attributes['name']; } }