'boolean' ]; protected $appends = ["banner_pc_url", "banner_mobile_url"]; public $translatable = ['title', 'banner_alt', 'description']; public function paragraphs(){ return $this->hasMany(EsgParagraph::class)->orderBy('order'); } protected function bannerPcUrl(): Attribute { return Attribute::make( get: fn ($value) => is_null($this->banner_pc) ? null :Storage::url($this->banner_pc), ); } protected function bannerMobileUrl(): Attribute { return Attribute::make( get: fn ($value) => is_null($this->banner_mobile) ? null :Storage::url($this->banner_mobile), ); } protected function getContentByKeyword($keyword){ return $this->where("keyword", $keyword)->with('paragraphs')->first(); } }