belongsTo(Page::class); } public function categories(): HasMany { return $this->hasMany(Category::class); } public function rootCategories(): HasMany { return $this->categories()->where(['parent_id' => 0]); } public function entries(): HasMany { return $this->hasMany(Entry::class); } public function getParsedTypeAttribute(): array { return ['name' => $this->type, 'title' => RegistryType::TITLES[$this->type] ?? null, 'options' => $this->options]; } public function getOptionsAttribute(): array { return RegistryType::OPTIONS[$this->type] ?? []; } }