0

I'm using mcamara/laravel-localization. I need to get languages from db instead of laravellocalization config file. Any ideas how to do that. I would be so grateful.

Mikayel
  • 15
  • 12

1 Answers1

1

Your best option is to use the laravel translation loader:

Install Laravel translation loader through Composer:

composer require spatie/laravel-translation-loader

Then publish Laravel translation loader migration file:

 php artisan vendor:publish --provider="Spatie\TranslationLoader\TranslationServiceProvider" --tag="migrations"

Finally, run the migrations; it will create a new table called language_lines in the database:

php artisan migrate

UPDATE: for laravel 6+ see the Issue @ github

source: Laravel news

Madan Sapkota
  • 25,047
  • 11
  • 113
  • 117
emekamba
  • 188
  • 9