@php $routeName = request()->route()?->getName() ?? ''; $ziggyGroups = ['public']; $requiresAuthRoutes = \Illuminate\Support\Str::is( ['login', 'logout', 'register', 'profile.*', 'password.*', 'verification.*', 'appearance'], $routeName, ); $isAdminRoute = $routeName === 'dashboard' || \Illuminate\Support\Str::startsWith($routeName, 'admin.'); if ($isAdminRoute) { $ziggyGroups[] = 'auth'; $ziggyGroups[] = 'admin'; } elseif (auth()->check() || $requiresAuthRoutes) { $ziggyGroups[] = 'auth'; } @endphp @routes($ziggyGroups, nonce: \Illuminate\Support\Facades\Vite::cspNonce()) @vite(['resources/js/app.ts']) @inertiaHead @inertia