mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Fix dashboard route overwritten by home redirect when using tenant slug attribute (#19584)
* Fix dashboard route overwritten by home redirect when using tenant slug attribute
`Route::getLastGroupPrefix()` returns the raw group prefix including
binding syntax (e.g. `admin/{tenant:slug}`), but Laravel's
`RouteCollection` indexes routes by the normalized URI without binding
syntax (e.g. `admin/{tenant}`). The `isset()` check on line 182 fails
due to this key mismatch when a tenant slug attribute is configured,
causing the home redirect to be created at `/` and overwrite the
Dashboard route.
The fix strips binding syntax from the root URI before looking it up
in the route collection.
Fixes filamentphp/filament#19582
* update snapshots
---------
Co-authored-by: Dan Harrin <git@danharrin.com>
This commit is contained in:
co-authored by
Dan Harrin
parent
1d78f0123e
commit
7e4b8a5b0e
@@ -13,6 +13,7 @@ class TeamFactory extends Factory
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->company(),
|
||||
'slug' => $this->faker->unique()->slug(),
|
||||
'description' => $this->faker->sentence(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ return new class extends Migration
|
||||
Schema::create('teams', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('slug')->unique()->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->decimal('budget', 10, 2)->default(0);
|
||||
$table->foreignId('company_id')->nullable();
|
||||
|
||||
Reference in New Issue
Block a user