#Can I have named routes for a panel

24 messages · Page 1 of 1 (latest)

jaunty foxBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

timber thistle
#

All routes should be named. You mean whether you can override the name for a route?

strange kestrel
#

no, what I mean is that I would like to substitute the default route('dashboard') with a panel, but even as the panel id is dashboard it does not work as the dashboard panel is not a named route

#

sure /dashboard works

#
<div class="pt-2 pb-3 space-y-1">
            <x-responsive-nav-link href="{{ route('dashboard') }}" :active="request()->routeIs('dashboard')">
                {{ __('Dashboard') }}
            </x-responsive-nav-link>
        </div>
#

does not work because the panel does not have a named route

#

normally in wep.php one have something like this:

 Route::get('/dashboard', function () {
        return view('dashboard');
    })->name('dashboard');

as you can see then name of the route is dashboard

#

where as a panel does not have a 'name'

#

if i do:
php artisan route:list

#
  GET|HEAD  dashboard ................................................................................................................................................................................................................................ filament.dashboard.pages.dashboard › Filament\Pages › Dashboard
  GET|HEAD  dashboard-jet .............................................................................................................................................................................................................................................................................. dashboard-jet
```
#

and as you can see the last is a named route

timber thistle
#

I don't get it

#

does not work because the panel does not have a named route
Panels aren't Pages. They cannot have routes.

#

would like to substitute the default route('dashboard') with a panel,
What do you mean by that? You want a panel named /dashboard next to another panel?

strange kestrel
#

in a blade view one can do this: {{ route('some-name') }} and some-name is defined as a named route in your web.php

timber thistle
strange kestrel
#

but I cannot do {{ route('dashboard') }} as the Filament pannel does not have named route

strange kestrel
#

because the named route 'dashboard' is not defined

timber thistle
strange kestrel
#

yes, that is the workaround 🙂

jaunty foxBOT
strange kestrel
#

Not sure you marked your answer as the solution - it does not work

timber thistle