user(); // Only what this account may reach, in the face it looks at. $navigation = $menu->for($user, array_values(array_filter($modules->permissionValues(), fn (string $permission) => $user?->can($permission)))); // What the big buttons of the simple start screen say: by the address of the menu item. $facts = []; foreach ($tiles->for($user) as $route => $fact) { $facts[route($route, [], false)] = $fact; } $help = (array) config('manager.simple.help', []); $site = config('manager.simple.site_link', '/'); return $request->wantsJson() ? response()->json([ 'navigation' => $navigation, 'facts' => (object) $facts, // A way to ask for help (a name and a link, for example a WhatsApp link) and a link to the site, under the buttons. 'help' => is_string($help['link'] ?? null) && ($help['link'] ?? '') !== '' ? ['name' => (string) ($help['name'] ?? ''), 'link' => $help['link']] : null, 'site' => is_string($site) && $site !== '' ? $site : null, ]) : view('manager::dashboard', ['navigation' => $navigation]); } }