FAQ
Do you have any example code?
Can I ask you some questions?
Is there anything I can help you with?
How to fix collisions with other traits/methods?
How do I migrate my existing table to use laravel-translatable?
// We insert the old attributes into the fresh translation table:
\DB::statement("insert into country_translations (country_id, name, locale) select id, name, 'en' from countries");
// We drop the translation attributes in our main table:
Schema::table('posts', function ($table) {
$table->dropColumn('title');
$table->dropColumn('content');
});How do I sort by translations?
How can I select a model by translated field?
Why do I get a mysql error while running the migrations?
How to fix
Last updated
Was this helpful?