@php // Shared Ladill app launcher — IDENTICAL across every app/service. // Driven by config/ladill_launcher.php (fully-extracted apps only) + icons // from public/images/launcher-icons/. Omits the current app (matched by // APP_URL host). Scoped team members only see apps they can access; the // launcher is hidden entirely when they only have one app (or none). $sidebar = (bool) ($sidebar ?? false); $selfHost = parse_url((string) config('app.url'), PHP_URL_HOST); $allowedSlugs = \App\Support\StaffUx::allowedAppSlugs(auth()->user()); $launcherApps = array_values(array_filter( config('ladill_launcher.apps', []), function (array $app) use ($selfHost, $allowedSlugs) { if (parse_url($app['url'], PHP_URL_HOST) === $selfHost) { return false; } if ($allowedSlugs === null) { return true; } $host = (string) parse_url($app['url'], PHP_URL_HOST); $root = (string) config('app.platform_domain', 'ladill.com'); $suffix = '.'.$root; if (! str_ends_with($host, $suffix)) { return false; } $sub = substr($host, 0, -strlen($suffix)); foreach ($allowedSlugs as $slug) { if ($slug === $sub || str_starts_with($sub, $slug)) { return true; } } // Launcher URLs may use marketing hostnames — match by known slug keys. $slug = match (true) { str_starts_with($host, 'care.') => 'care', str_starts_with($host, 'meet.') => 'meet', str_starts_with($host, 'queue.') => 'queue', str_starts_with($host, 'frontdesk.') => 'frontdesk', str_starts_with($host, 'mail.') => 'mail', str_starts_with($host, 'email.') => 'email', default => explode('.', $host)[0] ?? null, }; return $slug && in_array($slug, $allowedSlugs, true); } )); // Single-app staff: no launcher (they already are in their only app). if ($allowedSlugs !== null && count($allowedSlugs) <= 1) { $launcherApps = []; } $launcherOverflows = count($launcherApps) > 15; @endphp @if (! empty($launcherApps) && \App\Support\StaffUx::showProductHub(auth()->user()))
All apps