/** * Get the instance as an array. * * @return array */ public function toArray() { return ['name' => $this->name, 'title' => $this->title, 'url' => $this->url, 'icon' => $this->icon, 'active' => $this->active, 'roles' => $this->roles, 'permissions' => $this->permissions, 'children' => $this->children->toArray()]; }