Added the ability to dynamically translate on the project website.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('project_languages', function (Blueprint $table) {
|
||||
$table->unsignedInteger('system_lang')->nullable()->after('sort');
|
||||
$table->string('iso_code', 30)->nullable()->after('system_lang');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('project_languages', function (Blueprint $table) {
|
||||
$table->dropColumn('system_lang');
|
||||
$table->dropColumn('iso_code');
|
||||
});
|
||||
}
|
||||
};
|
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('project_translations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('code');
|
||||
$table->text('text');
|
||||
$table->unsignedBigInteger('project_id')->index();
|
||||
$table->foreign('project_id')->references('id')->on('projects');
|
||||
$table->unsignedBigInteger('language_id')->index();
|
||||
$table->foreign('language_id')->references('id')->on('project_languages');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->index(['project_id', 'language_id', 'deleted_at']);
|
||||
$table->unique(['project_id', 'language_id', 'code']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('project_translations');
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user