how to set locale from dashboard in filament

how to set locale from dashboard in filament
9 Replies
awcodes
awcodes6mo ago
Filament
Language Switch by Bezhan Salleh - Filament
Zero config Language Switcher plugin for Filament Panels.
JJSanders
JJSanders6mo ago
Why would you not do this in "config/app" ?
mohamedali5738
mohamedali57386mo ago
i want user choose from dashboard locale then active this locale in config i am using it but i want to set locale form dashboard by user not bu developer . i want to it dynmic
awcodes
awcodes6mo ago
my understanding of the plugin is that it adds a dropdown to the topbar to do just that.
mohamedali5738
mohamedali57386mo ago
do create table for locale ( locale and flag) as column then update config file with this table ?
awcodes
awcodes6mo ago
are you trying to have the user set their locale and store it in the database?
mohamedali5738
mohamedali57386mo ago
yes i want to make setlocale dynmic from user dashboard not by dev
awcodes
awcodes6mo ago
then you would just have them enter it in a standard form. then use a middleware to
app()->setLocale($user->locale ?? 'en')
app()->setLocale($user->locale ?? 'en')
or similar or you could do it in a service provider boot method too, probably.
mohamedali5738
mohamedali57386mo ago
ok i will try this solution thanks