F
Filament16mo ago
青木

How do I add a route that skips the tenant prefix?

i try Route::get('/bind', BindTeam::class)->name('bind'); in routes The route can be found via php artisan route:list, but accessing it in a browser results in a 404.
<?php

namespace App\Providers\Filament;

use App\Filament\Team\Pages\Tenancy\BindTeam;
use App\Filament\Team\Pages\Tenancy\RegistryTeam;
use App\Models\Team;

class TeamPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel->default()
->id('portal')
->path('portal')
...
->tenant(Team::class, slugAttribute: 'slug')
->tenantRegistration(RegistryTeam::class)
->tenantRoutes(function (Panel $panel) {
// add to /portal/{teamSlug}/*
})
->routes(function (Panel $panel) {
// add to /portal/*
Route::get('/bind', BindTeam::class)->name('bind');
})
...;
}
}
<?php

namespace App\Providers\Filament;

use App\Filament\Team\Pages\Tenancy\BindTeam;
use App\Filament\Team\Pages\Tenancy\RegistryTeam;
use App\Models\Team;

class TeamPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel->default()
->id('portal')
->path('portal')
...
->tenant(Team::class, slugAttribute: 'slug')
->tenantRegistration(RegistryTeam::class)
->tenantRoutes(function (Panel $panel) {
// add to /portal/{teamSlug}/*
})
->routes(function (Panel $panel) {
// add to /portal/*
Route::get('/bind', BindTeam::class)->name('bind');
})
...;
}
}
1 Reply
青木
青木OP16mo ago
GitHub
adjusting route priority fix #7809 by StringKe · Pull Request #7810...
Changes have been thoroughly tested to not break existing functionality. New functionality has been documented or existing documentation has been updated to reflect changes. Visual changes are ex...
Want results from more Discord servers?
Add your server