*/ protected $fillable = [ 'title_english', 'title_chinese', 'details_english', 'details_chinese', 'category', 'sort', ]; public function getTitleAttribute() { if (strtolower(app()->getLocale()) == 'zh_hk') { return $this->title_chinese; } return $this->title_english; } public function getDetailsAttribute() { if (strtolower(app()->getLocale()) == 'zh_hk') { return $this->detailss_chinese; } return $this->detailss_english; } public function getCategoryNameDisplayAttribute() { if ($this->category == 'faq') { return __("FAQ"); } return __("Online Documents"); } }