F
Filamentβ€’7mo ago
Skrypt

Locale Prefix

Hi, how would you go about creating localized routes for filament? I need routes like: - /en/admin/... for english admin panel, - /de/admin/... for german admin panel and so on Is there any way to override the routes.php file of filament? Or preferably just extend it?
7 Replies
Vp
Vpβ€’7mo ago
FilamentPHP Glow
add locale parameter to all of your filament panel
Skrypt
SkryptOPβ€’7mo ago
Thanks, I did that too. But the thing is, for the default locale (such as en) I need it to work without the prefix, so /admin will be english but /de/admin will be german.
Vp
Vpβ€’7mo ago
I didn't check but make it nullable '{local?}/admin'
Skrypt
SkryptOPβ€’7mo ago
Nah that doesn't work either. Then it probably just thinks that the locale is admin. We use https://github.com/codezero-be/laravel-localized-routes on the front-facing part of the app and are trying to make it compatible with the filament panels and I'm having a hard time doing so. πŸ˜„ The package itself does a lot of magic to make it work it seems
GitHub
GitHub - codezero-be/laravel-localized-routes: ⭐️ A convenient way ...
⭐️ A convenient way to set up and use localized routes in a Laravel app. - codezero-be/laravel-localized-routes
Vp
Vpβ€’7mo ago
No idea now, sorry
Skrypt
SkryptOPβ€’7mo ago
np, thanks anyways πŸ™‚
Ashk
Ashkβ€’6mo ago
@Lukas Frey I have the same need for my panels, I'd like to have the locale in my url but it's a real pain... So you didn't have any issues with this package ? https://github.com/codezero-be/laravel-localized-routes
GitHub
GitHub - codezero-be/laravel-localized-routes: ⭐️ A convenient way ...
⭐️ A convenient way to set up and use localized routes in a Laravel app. - codezero-be/laravel-localized-routes
Want results from more Discord servers?
Add your server