Change profile route slug?

Is it possible to change the profile route slug? Like it is possible to do this for autentication routes in the panelprovider:
->loginRouteSlug('login')
->registrationRouteSlug('register')
->passwordResetRoutePrefix('password-reset')
->passwordResetRequestRouteSlug('request')
->passwordResetRouteSlug('reset')
->emailVerificationRoutePrefix('email-verification')
->emailVerificationPromptRouteSlug('prompt')
->emailVerificationRouteSlug('verify');
->loginRouteSlug('login')
->registrationRouteSlug('register')
->passwordResetRoutePrefix('password-reset')
->passwordResetRequestRouteSlug('request')
->passwordResetRouteSlug('reset')
->emailVerificationRoutePrefix('email-verification')
->emailVerificationPromptRouteSlug('prompt')
->emailVerificationRouteSlug('verify');
I also want to change route slug for profile from '/profile' to '/account'. Thanks!
1 Reply
hyperion-mx
hyperion-mx3w ago
on the panel there is a profile method which can pass a custom profile class, if you want to use the Filament EditProfile class you can extend it and override the $slug here is an example
<?php

namespace App\Classes;

use Filament\Pages\Auth\EditProfile;

class CustomProfile extends EditProfile {
protected static ?string $slug = 'custom-profile';
}
<?php

namespace App\Classes;

use Filament\Pages\Auth\EditProfile;

class CustomProfile extends EditProfile {
protected static ?string $slug = 'custom-profile';
}
and use it on the panel
public function panel(Panel $panel): Panel {
return $panel
->default()
->id('admin')
->path('admin')
->login()
->colors([
'primary' => Color::Amber,
])
->profile(CustomProfile::class)
..........
public function panel(Panel $panel): Panel {
return $panel
->default()
->id('admin')
->path('admin')
->login()
->colors([
'primary' => Color::Amber,
])
->profile(CustomProfile::class)
..........
Hope that helps
Want results from more Discord servers?
Add your server