items($items); } /** * Set menu's items. * * @param array $items * @return $this */ public function items($items = []) { $this->items = new MenuCollection($items); return $this; } /** * Prepare the menu for JSON serialization. * * @return array */ public function jsonSerialize(): array { $request = app(NovaRequest::class); return [ 'component' => $this->component, 'items' => $this->items->authorized($request)->withoutEmptyItems()->all(), ]; } }