How can I add a locale as a url parameter on a panel?
I tried adding a locale parameter to my code so that instead of this:
I have this:
But that did not work.
Solution:Jump to solution
create a Middleware and register it in filament panel
URL::defaults(['local' => 'en']);
change en to the lang, if you want to get it from session or user profile or any logic you want...5 Replies
Solution
create a Middleware and register it in filament panel
URL::defaults(['local' => 'en']);
change en to the lang, if you want to get it from session or user profile or any logic you want
I used it like this
->path('{local}/admin')
in
middleware()
or authMiddleware()
middleware
test it thoroughly tho
since can affect other parts, my app was so simple
no tenant or advanced stuff π
I have a question related to localization, but not directly to this topic. Is there a way to change the label of a button inorder to remove the resource name without using the
label()
method. It seems useful to have all of the buttons of action translated natively in Filament, but when the resource name is used, the translations get wonkey. For exaple, in English "Create book" is fine, but in panish, "Crear book" is not correct. It would be create to just have the button say "Create" or "Crear," but withut using the lbel method so all the native translations kick in. You have any experence with that?this too late, I didnt get a notifications sorry π
most of the component if not all of them have a method
configureUsing
to add it to any provider and it will apply to all
like this:
https://github.com/lara-zeus/tartarus/blob/1.x/src/Providers/FilamentPanelProvider.php#L102GitHub
tartarus/src/Providers/FilamentPanelProvider.php at 1.x Β· lara-zeus...
simple multi tenants with panels. Contribute to lara-zeus/tartarus development by creating an account on GitHub.