{{-- Tipografia --}} {{-- CSS existente --}} @stack('styles') @php $route = optional(request()->route())->getName(); $path = trim(request()->path(), '/'); $isSuperAdmin = isset($isSuperAdmin) ? (bool)$isSuperAdmin : false; $isRole2 = isset($isRole2) ? (bool)$isRole2 : false; $menuLimitedRole2 = isset($menuLimitedRole2) ? (bool)$menuLimitedRole2 : false; // Cada item: [label, routeName] $map = [ 'admin.dashboard' => [ ['Dashboard', 'admin.dashboard'] ], 'admin.chat.index' => [ ['Chat', 'admin.chat.index'] ], 'admin.clubs.index' => [ ['Clubes', 'admin.clubs.index'] ], 'admin.clubs.show' => [ ['Clubes', 'admin.clubs.index'], ['Detalhe', null] ], 'admin.clubs.edit' => [ ['Clubes', 'admin.clubs.index'], ['Editar', null] ], 'admin.users.index' => [ ['Utilizadores', 'admin.users.index'] ], 'admin.users.show' => [ ['Utilizadores', 'admin.users.index'], ['Detalhe', null] ], 'admin.users.edit' => [ ['Utilizadores', 'admin.users.index'], ['Editar', null] ], 'admin.categories.index' => [ ['Categorias', 'admin.categories.index'] ], 'admin.subcategories.index' => [ ['Subcategorias', 'admin.subcategories.index'] ], 'admin.products.index' => [ ['Produtos', 'admin.products.index'] ], 'admin.point-store-products.index' => [ ['Loja de pontos', 'admin.point-store-products.index'] ], 'admin.point-store-products.create' => [ ['Loja de pontos', 'admin.point-store-products.index'], ['Novo', null] ], 'admin.point-store-products.edit' => [ ['Loja de pontos', 'admin.point-store-products.index'], ['Editar', null] ], 'admin.financial.index' => [ ['Financeiro', 'admin.financial.index'] ], 'admin.financial.expenses.create' => [ ['Financeiro', 'admin.financial.index'], ['Criar despesa', null] ], 'admin.financial.revenues.create' => [ ['Financeiro', 'admin.financial.index'], ['Criar receita', null] ], 'admin.contact-documents.index' => [ ['Documentos e Contactos', 'admin.contact-documents.index'] ], 'admin.contact-documents.create' => [ ['Documentos e Contactos', 'admin.contact-documents.index'], ['Novo', null] ], 'admin.contact-documents.edit' => [ ['Documentos e Contactos', 'admin.contact-documents.index'], ['Editar', null] ], 'admin.settings.edit' => [ ['Definições', 'admin.settings.edit'] ], 'admin.news.index' => [ ['Notícias', 'admin.news.index'] ], 'admin.news.create' => [ ['Notícias', 'admin.news.index'], ['Nova', null] ], 'admin.news.edit' => [ ['Notícias', 'admin.news.index'], ['Editar', null] ], 'admin.news.show' => [ ['Notícias', 'admin.news.index'], ['Ver', null] ], ]; $crumbs = $map[$route] ?? null; // fallback simples pelo path (linka para /admin/ quando fizer sentido) if(!$crumbs){ if($path === '' || $path === 'admin'){ $crumbs = [ ['Dashboard', 'admin.dashboard'] ]; } else { $parts = collect(explode('/', $path))->filter()->values(); // ex: ['admin','clubs','123'] $section = $parts[1] ?? $parts[0] ?? null; // tenta apanhar a secção a seguir ao "admin" $label = $section ? ucfirst(str_replace('-', ' ', $section)) : 'Backoffice'; $href = ($section && $section !== 'admin') ? url('/admin/'.$section) : route('admin.dashboard'); $crumbs = [ [''.$label, null] ]; // sem routeName garantido // se quiseres link no fallback, troca a linha acima por: // $crumbs = [ [''.$label, $href] ]; } } $mainLabel = $crumbs[0][0] ?? 'Backoffice'; $mainRoute = $crumbs[0][1] ?? null; $subLabel = $crumbs[1][0] ?? null; @endphp
{{-- SIDEBAR --}} {{-- TOPBAR --}}
{{-- Mobile menu --}} {{-- Desktop collapse toggle --}} {{-- Breadcrumbs --}}
@if($mainRoute) {{ $mainLabel }} @else {{ $mainLabel }} @endif @if($subLabel) / {{ $subLabel }} @endif
{{-- Notificações (internas) --}}
@csrf
@csrf
{{-- BACKDROP (mobile) --}} {{-- MAIN --}}
@if(session('ok'))
{{ session('ok') }}
@endif @if ($errors->any())
Ocorreu um erro:
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif @yield('content')
@stack('scripts')