Spatie translatable plugin issue or not

How to pass default locales from a database? Although, code below works, but it breaks the application when you try to run for example php artisan migrate on a fresh database.
->plugin(
SpatieLaravelTranslatablePlugin::make()
->defaultLocales(Language::all()->pluck('code')->toArray())
)
->plugin(
SpatieLaravelTranslatablePlugin::make()
->defaultLocales(Language::all()->pluck('code')->toArray())
)
1 Reply
Lara Zeus
Lara Zeus6d ago
how you want to pass local from database when the database is empty? 🙂 I guess you can check if the query return empty data then set it manually

Did you find this page helpful?