Closed Nejcc closed 3 years ago
I suggest insted using enum in user migration use relation id
current
public function up() { Schema::create('users', function (Blueprint $table) { ... $table->enum('locale', ['de','en'])->default('en'); }); }
Replace with
public function up() { Schema::create('users', function (Blueprint $table) { ... $table->unasignedBigInteger('language_id')->default(1); }); }
Also make
php artisan make:model Utilities/Language -m
Schema::create('languages', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name'); $table->string('name_short')->unique(); $table->string('country_code')->unique(); $table->string('code')->unique(); $table->timestamps(); }); Language::truncate(); Language::create([ 'name' => 'English', 'name_short' => 'en', 'country_code' => 'gb', 'code' => 'gb', ]);
And for better usage put in .env.example AND .env LANGUAGE_DEFAULT=de
LANGUAGE_DEFAULT=de
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I suggest insted using enum in user migration use relation id
current
Replace with
current
Also make
And for better usage put in .env.example AND .env
LANGUAGE_DEFAULT=de