Closed valpuia closed 1 year ago
What I did is, I created a settings page (spatie-settings), where I have Select with hardcoded values of "available" languages. Then in AppServiceProvider boot method I added:
config([
'filament-spatie-laravel-translatable-plugin.default_locales' => app(GeneralSettings::class)->site_languages
]);
You could make a new resource and use that to read languages from database for example.
Hi, is there a way to display the languages from database..
Normally we have
App\Models\Language
to store all of our supported languages, and we need tocomment/uncomment
the languages fromconfig
based on the languages we supported.. If we make one languagesactive/inactive
fromdatabase
then we need to changeconfig
and push the changes again and again..So if there is an option to load
languages (locale, name, flag)
from database base onquery()
and it will be very convenient for all the end user as wellSorry for bad english.. thanks in advance