create('settings', function ($menu) { $menu->style('tailwind'); if (! SystemAccess::canOpenSettings()) { return; } $items = [ ['system-settings.users.index', '用户管理', 'people', '用户 类型 权限'], ['system-settings.sidebar.edit', '侧边栏管理', 'menu', '侧边栏 用户类型 指定管理员'], ['system-settings.databases.index', '数据库管理', 'storage', '系统数据库 云数据库 上游 连接 测试'], ]; foreach ($items as $index => [$route, $title, $icon, $keywords]) { if ($this->keyword && ! Str::contains(Str::lower($title . ' ' . $keywords), Str::lower($this->keyword))) { continue; } $item = $menu->route($route, $title, [], ($index + 1) * 10, [ 'icon' => $icon, 'search_keywords' => $keywords, ]); if ($item->isActive()) { $this->active_menu = 1; } } }); return view('livewire.menu.settings'); } public function resetKeyword(): void { $this->keyword = ''; } }