Wow....no one offered a single tip :/
multilingual database
I hope this thread finds everyone healthy.
I am designing a multilingual database using laravel eloquent.
Here is my tables and codes:
Schema::create('locales', function(Blueprint $table)
{
$table->increments('id');
$table->string('code', 2);
$table->string('name');
});
Schema::create('products', function(Blueprint $table)
{
$table->increments('id');
$table->string('thumbnail');
$table->string('images');
$table->timestamps();
});
Schema::create('product_translations', function(Blueprint $table)
{
$table->increments('id');
$table->string('name');
$table->string('content');
$table->integer('product_id')->unsigned();
$table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
$table->integer('locale_id')->unsigned();
$table->foreign('locale_id')->references('id')->on('locales')->onDelete('cascade');
$table->unique(['product_id', 'locale_id']);
});
And it is working fine. But now i have to create another table for product categories. There are 3 categories for each product. but each category will be translated. and since i don't have much experience with multilingual db designs, i don't know what is the proper way to do it.
Can somebody post a code how the new category table should look?
Here is my product_categories table so far:
Schema::create('product_categories', function(Blueprint $table)
{
$table->increments('id');
$table->string('locale_id');
$table->string('category');
});
Thanks in advance!!
Please or to participate in this conversation.