$this->id, 'slug' => $this->slug, 'name' => $this->getTranslated('name_key'), 'description' => $this->getTranslated('description_key'), 'icon' => $this->icon, 'category' => $this->category, 'level' => $this->getCurrentLevel(), 'max_level' => $this->max_level, 'display_order' => $this->display_order, 'project_count' => $this->whenLoaded('projects', fn () => $this->projects->count()), 'pivot' => $this->when($this->pivot, fn () => [ 'level_before' => $this->pivot->level_before, 'level_after' => $this->pivot->level_after, ]), ]; } }