*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'label' => $this->label, 'url' => $this->url, 'location' => $this->location?->value, 'type' => $this->type?->value, 'parent_id' => $this->parent_id, 'order_index' => $this->order_index, 'is_active' => $this->is_active, 'children' => self::collection($this->whenLoaded('children')), 'created_at' => $this->created_at?->toISOString(), 'updated_at' => $this->updated_at?->toISOString(), ]; } }