'array', 'custom' => 'array', ]; } protected function images(): Attribute { return Attribute::make( get: function ($value) { if (empty($value)) { return []; } $parts = explode(',', $value); return array_map(fn($part) => asset(trim($part)), $parts); } ); } protected function image(): Attribute { return Attribute::make( get: fn($value) => asset($value), ); } protected function banner(): Attribute { return Attribute::make( get: fn($value) => asset($value), ); } protected function sidebarImage(): Attribute { return Attribute::make( get: fn($value) => asset($value), ); } public function children() { return $this->belongsToMany( Page::class, 'page_relationship', 'parent_page_id', 'child_page_id', 'id', 'id' ); } public function parents() { return $this->belongsToMany( Page::class, 'page_relationship', 'child_page_id', 'parent_page_id', 'id', 'id' ); } }