0% found this document useful (0 votes)
5 views2 pages

Laravel Migration for Meta Translations

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Laravel Migration for Meta Translations

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

<?

php

use Illuminate\Database\Migrations\Migration;

use Illuminate\Database\Schema\Blueprint;

use Illuminate\Support\Facades\Schema;

return new class extends Migration

/**

* Run the migrations.

* @return void

*/

public function up()

Schema::create('meta_translations', function (Blueprint $table) {

$table->id();

$table->unsignedBigInteger('meta_id');

$table->string('page');

$table->string('url');

$table->string('domain');

$table->string('locale');

$table->string('meta_title');

$table->string('meta_keyword');

$table->string('meta_description');

$table->string('thumbnail_alt')->nullable();

$table->unique(['locale', 'meta_id']);

$table->foreign('meta_id')

->references('id')
->on('metas')

->onDelete('cascade');

$table->boolean('active_locale')->default(false);

$table->softDeletes();

$table->timestamps();

});

/**

* Reverse the migrations.

* @return void

*/

public function down()

Schema::dropIfExists('meta_translations');

};

You might also like