Stand: SMTP-Test, Admin-Mail-Tab, Notifiable-Fix, Lazy-Quill
- Fix: Notifiable-Trait zum User-Model hinzugefuegt (behebt notify()-500er) - Installer: SMTP-Verbindungstest mit EsmtpTransport + Ueberspringen-Link - Admin: Neuer E-Mail-Tab mit SMTP-Konfiguration + Verbindungstest - Admin: Lazy Quill-Initialisierung (nur sichtbare Locale wird geladen) - Uebersetzungen: 17 neue Mail-Keys in allen 6 Sprachen Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
52
database/migrations/0001_01_01_000000_create_users_table.php
Executable file
52
database/migrations/0001_01_01_000000_create_users_table.php
Executable file
@@ -0,0 +1,52 @@
|
||||
<?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('users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('email')->unique();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->string('role', 20)->default('user');
|
||||
$table->boolean('is_active')->default(true);
|
||||
$table->timestamp('last_login_at')->nullable();
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('password_reset_tokens', function (Blueprint $table) {
|
||||
$table->string('email')->primary();
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
|
||||
Schema::create('sessions', function (Blueprint $table) {
|
||||
$table->string('id')->primary();
|
||||
$table->foreignId('user_id')->nullable()->index();
|
||||
$table->string('ip_address', 45)->nullable();
|
||||
$table->text('user_agent')->nullable();
|
||||
$table->longText('payload');
|
||||
$table->integer('last_activity')->index();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
Schema::dropIfExists('password_reset_tokens');
|
||||
Schema::dropIfExists('sessions');
|
||||
}
|
||||
};
|
||||
35
database/migrations/0001_01_01_000001_create_cache_table.php
Executable file
35
database/migrations/0001_01_01_000001_create_cache_table.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?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('cache', function (Blueprint $table) {
|
||||
$table->string('key')->primary();
|
||||
$table->mediumText('value');
|
||||
$table->integer('expiration')->index();
|
||||
});
|
||||
|
||||
Schema::create('cache_locks', function (Blueprint $table) {
|
||||
$table->string('key')->primary();
|
||||
$table->string('owner');
|
||||
$table->integer('expiration')->index();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('cache');
|
||||
Schema::dropIfExists('cache_locks');
|
||||
}
|
||||
};
|
||||
57
database/migrations/0001_01_01_000002_create_jobs_table.php
Executable file
57
database/migrations/0001_01_01_000002_create_jobs_table.php
Executable file
@@ -0,0 +1,57 @@
|
||||
<?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('jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('queue')->index();
|
||||
$table->longText('payload');
|
||||
$table->unsignedTinyInteger('attempts');
|
||||
$table->unsignedInteger('reserved_at')->nullable();
|
||||
$table->unsignedInteger('available_at');
|
||||
$table->unsignedInteger('created_at');
|
||||
});
|
||||
|
||||
Schema::create('job_batches', function (Blueprint $table) {
|
||||
$table->string('id')->primary();
|
||||
$table->string('name');
|
||||
$table->integer('total_jobs');
|
||||
$table->integer('pending_jobs');
|
||||
$table->integer('failed_jobs');
|
||||
$table->longText('failed_job_ids');
|
||||
$table->mediumText('options')->nullable();
|
||||
$table->integer('cancelled_at')->nullable();
|
||||
$table->integer('created_at');
|
||||
$table->integer('finished_at')->nullable();
|
||||
});
|
||||
|
||||
Schema::create('failed_jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('uuid')->unique();
|
||||
$table->text('connection');
|
||||
$table->text('queue');
|
||||
$table->longText('payload');
|
||||
$table->longText('exception');
|
||||
$table->timestamp('failed_at')->useCurrent();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('jobs');
|
||||
Schema::dropIfExists('job_batches');
|
||||
Schema::dropIfExists('failed_jobs');
|
||||
}
|
||||
};
|
||||
24
database/migrations/0002_01_01_000000_create_teams_table.php
Executable file
24
database/migrations/0002_01_01_000000_create_teams_table.php
Executable file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('teams', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('year_group', 20)->nullable();
|
||||
$table->boolean('is_active')->default(true);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('teams');
|
||||
}
|
||||
};
|
||||
29
database/migrations/0003_01_01_000000_create_players_table.php
Executable file
29
database/migrations/0003_01_01_000000_create_players_table.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('players', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('team_id')->constrained('teams')->restrictOnDelete();
|
||||
$table->string('first_name', 100);
|
||||
$table->string('last_name', 100);
|
||||
$table->unsignedSmallInteger('birth_year')->nullable();
|
||||
$table->unsignedSmallInteger('jersey_number')->nullable();
|
||||
$table->boolean('is_active')->default(true);
|
||||
$table->boolean('photo_permission')->default(false);
|
||||
$table->text('notes')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('players');
|
||||
}
|
||||
};
|
||||
26
database/migrations/0004_01_01_000000_create_parent_player_table.php
Executable file
26
database/migrations/0004_01_01_000000_create_parent_player_table.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('parent_player', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('parent_id')->constrained('users')->cascadeOnDelete();
|
||||
$table->foreignId('player_id')->constrained('players')->cascadeOnDelete();
|
||||
$table->string('relationship_label', 50)->nullable();
|
||||
$table->timestamp('created_at')->nullable();
|
||||
|
||||
$table->unique(['parent_id', 'player_id']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('parent_player');
|
||||
}
|
||||
};
|
||||
26
database/migrations/0005_01_01_000000_create_invitations_table.php
Executable file
26
database/migrations/0005_01_01_000000_create_invitations_table.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('invitations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('token', 64)->unique();
|
||||
$table->string('email')->nullable();
|
||||
$table->foreignId('created_by')->constrained('users')->restrictOnDelete();
|
||||
$table->dateTime('expires_at');
|
||||
$table->dateTime('accepted_at')->nullable();
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('invitations');
|
||||
}
|
||||
};
|
||||
23
database/migrations/0006_01_01_000000_create_invitation_players_table.php
Executable file
23
database/migrations/0006_01_01_000000_create_invitation_players_table.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('invitation_players', function (Blueprint $table) {
|
||||
$table->foreignId('invitation_id')->constrained('invitations')->cascadeOnDelete();
|
||||
$table->foreignId('player_id')->constrained('players')->cascadeOnDelete();
|
||||
|
||||
$table->primary(['invitation_id', 'player_id']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('invitation_players');
|
||||
}
|
||||
};
|
||||
38
database/migrations/0007_01_01_000000_create_events_table.php
Executable file
38
database/migrations/0007_01_01_000000_create_events_table.php
Executable file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('events', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('team_id')->constrained('teams')->restrictOnDelete();
|
||||
$table->string('type', 20);
|
||||
$table->string('title');
|
||||
$table->dateTime('start_at');
|
||||
$table->dateTime('end_at')->nullable();
|
||||
$table->string('status', 20)->default('published');
|
||||
$table->string('location_name')->nullable();
|
||||
$table->string('address_text', 500)->nullable();
|
||||
$table->decimal('location_lat', 10, 7)->nullable();
|
||||
$table->decimal('location_lng', 10, 7)->nullable();
|
||||
$table->text('description_html')->nullable();
|
||||
$table->foreignId('created_by')->constrained('users')->restrictOnDelete();
|
||||
$table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['team_id', 'start_at']);
|
||||
$table->index('start_at');
|
||||
$table->index('status');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('events');
|
||||
}
|
||||
};
|
||||
29
database/migrations/0008_01_01_000000_create_event_participants_table.php
Executable file
29
database/migrations/0008_01_01_000000_create_event_participants_table.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('event_participants', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('event_id')->constrained('events')->cascadeOnDelete();
|
||||
$table->foreignId('player_id')->constrained('players')->cascadeOnDelete();
|
||||
$table->string('status', 20)->default('unknown');
|
||||
$table->foreignId('set_by_user_id')->constrained('users')->restrictOnDelete();
|
||||
$table->string('note', 500)->nullable();
|
||||
$table->timestamp('responded_at')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['event_id', 'player_id']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('event_participants');
|
||||
}
|
||||
};
|
||||
27
database/migrations/0009_01_01_000000_create_event_catering_table.php
Executable file
27
database/migrations/0009_01_01_000000_create_event_catering_table.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('event_catering', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('event_id')->constrained('events')->cascadeOnDelete();
|
||||
$table->foreignId('user_id')->constrained('users')->cascadeOnDelete();
|
||||
$table->string('status', 20)->default('unknown');
|
||||
$table->text('note')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['event_id', 'user_id']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('event_catering');
|
||||
}
|
||||
};
|
||||
26
database/migrations/0010_01_01_000000_create_comments_table.php
Executable file
26
database/migrations/0010_01_01_000000_create_comments_table.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('comments', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('event_id')->constrained('events')->cascadeOnDelete();
|
||||
$table->foreignId('user_id')->constrained('users')->restrictOnDelete();
|
||||
$table->text('body');
|
||||
$table->timestamp('deleted_at')->nullable();
|
||||
$table->foreignId('deleted_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('comments');
|
||||
}
|
||||
};
|
||||
27
database/migrations/0011_01_01_000000_create_faq_table.php
Executable file
27
database/migrations/0011_01_01_000000_create_faq_table.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('faq', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title');
|
||||
$table->string('category', 100)->nullable();
|
||||
$table->text('content_html');
|
||||
$table->integer('sort_order')->default(0);
|
||||
$table->foreignId('created_by')->constrained('users')->restrictOnDelete();
|
||||
$table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('faq');
|
||||
}
|
||||
};
|
||||
23
database/migrations/0012_01_01_000000_create_event_faq_table.php
Executable file
23
database/migrations/0012_01_01_000000_create_event_faq_table.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('event_faq', function (Blueprint $table) {
|
||||
$table->foreignId('event_id')->constrained('events')->cascadeOnDelete();
|
||||
$table->foreignId('faq_id')->constrained('faq')->cascadeOnDelete();
|
||||
|
||||
$table->primary(['event_id', 'faq_id']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('event_faq');
|
||||
}
|
||||
};
|
||||
25
database/migrations/0013_01_01_000000_create_settings_table.php
Executable file
25
database/migrations/0013_01_01_000000_create_settings_table.php
Executable file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('settings', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('key', 100)->unique();
|
||||
$table->string('label', 255);
|
||||
$table->string('type', 20)->default('text'); // text, html
|
||||
$table->text('value')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('settings');
|
||||
}
|
||||
};
|
||||
22
database/migrations/0014_01_01_000000_add_locale_to_users_table.php
Executable file
22
database/migrations/0014_01_01_000000_add_locale_to_users_table.php
Executable file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->string('locale', 5)->default('de')->after('is_active');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('locale');
|
||||
});
|
||||
}
|
||||
};
|
||||
26
database/migrations/0016_01_01_000000_create_event_timekeepers_table.php
Executable file
26
database/migrations/0016_01_01_000000_create_event_timekeepers_table.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('event_timekeepers', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('event_id')->constrained()->cascadeOnDelete();
|
||||
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
|
||||
$table->string('status', 20)->default('unknown');
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['event_id', 'user_id']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('event_timekeepers');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('events', function (Blueprint $table) {
|
||||
$table->unsignedTinyInteger('min_players')->nullable()->after('description_html');
|
||||
$table->unsignedTinyInteger('min_catering')->nullable()->after('min_players');
|
||||
$table->unsignedTinyInteger('min_timekeepers')->nullable()->after('min_catering');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('events', function (Blueprint $table) {
|
||||
$table->dropColumn(['min_players', 'min_catering', 'min_timekeepers']);
|
||||
});
|
||||
}
|
||||
};
|
||||
25
database/migrations/0018_01_01_000000_create_locations_table.php
Executable file
25
database/migrations/0018_01_01_000000_create_locations_table.php
Executable file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('locations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('address_text')->nullable();
|
||||
$table->decimal('location_lat', 10, 7)->nullable();
|
||||
$table->decimal('location_lng', 10, 7)->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('locations');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('file_categories', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('slug')->unique();
|
||||
$table->integer('sort_order')->default(0);
|
||||
$table->boolean('is_active')->default(true);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('file_categories');
|
||||
}
|
||||
};
|
||||
31
database/migrations/0020_01_01_000000_create_files_table.php
Normal file
31
database/migrations/0020_01_01_000000_create_files_table.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('files', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('file_category_id')->constrained('file_categories')->cascadeOnDelete();
|
||||
$table->string('original_name');
|
||||
$table->string('stored_name');
|
||||
$table->string('mime_type', 100);
|
||||
$table->unsignedBigInteger('size');
|
||||
$table->string('disk', 20)->default('private');
|
||||
$table->foreignId('uploaded_by')->constrained('users')->cascadeOnDelete();
|
||||
$table->timestamps();
|
||||
|
||||
$table->index('file_category_id');
|
||||
$table->index('uploaded_by');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('files');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('event_file', function (Blueprint $table) {
|
||||
$table->foreignId('event_id')->constrained()->cascadeOnDelete();
|
||||
$table->foreignId('file_id')->constrained()->cascadeOnDelete();
|
||||
$table->primary(['event_id', 'file_id']);
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('event_file');
|
||||
}
|
||||
};
|
||||
@@ -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
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->string('profile_picture')->nullable()->after('locale');
|
||||
});
|
||||
|
||||
Schema::table('players', function (Blueprint $table) {
|
||||
$table->string('profile_picture')->nullable()->after('notes');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('profile_picture');
|
||||
});
|
||||
|
||||
Schema::table('players', function (Blueprint $table) {
|
||||
$table->dropColumn('profile_picture');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
// event_participants: Status-Abfragen (minimumsStatus, event-status-boxes)
|
||||
Schema::table('event_participants', function (Blueprint $table) {
|
||||
$table->index(['event_id', 'status'], 'ep_event_status_idx');
|
||||
});
|
||||
|
||||
// event_catering: Status-Abfragen (minimumsStatus)
|
||||
Schema::table('event_catering', function (Blueprint $table) {
|
||||
$table->index(['event_id', 'status'], 'ec_event_status_idx');
|
||||
});
|
||||
|
||||
// event_timekeepers: Status-Abfragen (minimumsStatus)
|
||||
Schema::table('event_timekeepers', function (Blueprint $table) {
|
||||
$table->index(['event_id', 'status'], 'et_event_status_idx');
|
||||
});
|
||||
|
||||
// comments: Event-Detail (sichtbare Kommentare)
|
||||
Schema::table('comments', function (Blueprint $table) {
|
||||
$table->index(['event_id', 'deleted_at'], 'comments_event_visible_idx');
|
||||
});
|
||||
|
||||
// events: Dashboard + Event-Listen (Status + Datum Kombination)
|
||||
Schema::table('events', function (Blueprint $table) {
|
||||
$table->index(['status', 'start_at'], 'events_status_start_idx');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('event_participants', function (Blueprint $table) {
|
||||
$table->dropIndex('ep_event_status_idx');
|
||||
});
|
||||
|
||||
Schema::table('event_catering', function (Blueprint $table) {
|
||||
$table->dropIndex('ec_event_status_idx');
|
||||
});
|
||||
|
||||
Schema::table('event_timekeepers', function (Blueprint $table) {
|
||||
$table->dropIndex('et_event_status_idx');
|
||||
});
|
||||
|
||||
Schema::table('comments', function (Blueprint $table) {
|
||||
$table->dropIndex('comments_event_visible_idx');
|
||||
});
|
||||
|
||||
Schema::table('events', function (Blueprint $table) {
|
||||
$table->dropIndex('events_status_start_idx');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -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
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->softDeletes();
|
||||
});
|
||||
|
||||
Schema::table('players', function (Blueprint $table) {
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropSoftDeletes();
|
||||
});
|
||||
|
||||
Schema::table('players', function (Blueprint $table) {
|
||||
$table->dropSoftDeletes();
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('activity_logs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->string('action', 50);
|
||||
$table->string('model_type', 50)->nullable();
|
||||
$table->unsignedBigInteger('model_id')->nullable();
|
||||
$table->string('description', 500);
|
||||
$table->json('properties')->nullable();
|
||||
$table->string('ip_address', 45)->nullable();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
|
||||
$table->index('action');
|
||||
$table->index('model_type');
|
||||
$table->index('created_at');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('activity_logs');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
// 1. Neue Felder: Gegner + Ergebnis
|
||||
Schema::table('events', function (Blueprint $table) {
|
||||
$table->string('opponent', 100)->nullable()->after('min_timekeepers');
|
||||
$table->unsignedTinyInteger('score_home')->nullable()->after('opponent');
|
||||
$table->unsignedTinyInteger('score_away')->nullable()->after('score_home');
|
||||
});
|
||||
|
||||
// 2. Daten-Migration: game → home_game
|
||||
DB::table('events')->where('type', 'game')->update(['type' => 'home_game']);
|
||||
|
||||
// 3. Settings-Keys umbenennen: game → home_game
|
||||
foreach (['players', 'catering', 'timekeepers'] as $field) {
|
||||
DB::table('settings')
|
||||
->where('key', "default_min_{$field}_game")
|
||||
->update([
|
||||
'key' => "default_min_{$field}_home_game",
|
||||
'label' => 'Default Min. ' . ucfirst($field) . ' (Home Game)',
|
||||
]);
|
||||
}
|
||||
|
||||
// 4. Neue Settings-Keys: away_game
|
||||
foreach (['players', 'catering', 'timekeepers'] as $field) {
|
||||
$key = "default_min_{$field}_away_game";
|
||||
$exists = DB::table('settings')->where('key', $key)->exists();
|
||||
if (!$exists) {
|
||||
DB::table('settings')->insert([
|
||||
'key' => $key,
|
||||
'label' => 'Default Min. ' . ucfirst($field) . ' (Away Game)',
|
||||
'type' => 'number',
|
||||
'value' => null,
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
// Settings zurück
|
||||
foreach (['players', 'catering', 'timekeepers'] as $field) {
|
||||
DB::table('settings')
|
||||
->where('key', "default_min_{$field}_home_game")
|
||||
->update([
|
||||
'key' => "default_min_{$field}_game",
|
||||
'label' => 'Default Min. ' . ucfirst($field) . ' (Game)',
|
||||
]);
|
||||
DB::table('settings')->where('key', "default_min_{$field}_away_game")->delete();
|
||||
}
|
||||
|
||||
// Daten zurück
|
||||
DB::table('events')->where('type', 'home_game')->update(['type' => 'game']);
|
||||
DB::table('events')->where('type', 'away_game')->update(['type' => 'game']);
|
||||
|
||||
Schema::table('events', function (Blueprint $table) {
|
||||
$table->dropColumn(['opponent', 'score_home', 'score_away']);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
$driver = DB::getDriverName();
|
||||
|
||||
if ($driver === 'sqlite') {
|
||||
// SQLite kann player_id nicht einfach nullable machen — Table-Rebuild nötig
|
||||
DB::statement('PRAGMA foreign_keys = OFF');
|
||||
|
||||
DB::statement('CREATE TABLE event_participants_new (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
event_id BIGINT UNSIGNED NOT NULL,
|
||||
player_id BIGINT UNSIGNED NULL,
|
||||
user_id BIGINT UNSIGNED NULL,
|
||||
status VARCHAR(20) DEFAULT \'unknown\',
|
||||
set_by_user_id BIGINT UNSIGNED NOT NULL,
|
||||
note VARCHAR(500) NULL,
|
||||
responded_at TIMESTAMP NULL,
|
||||
created_at TIMESTAMP NULL,
|
||||
updated_at TIMESTAMP NULL,
|
||||
FOREIGN KEY (event_id) REFERENCES events(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (player_id) REFERENCES players(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (set_by_user_id) REFERENCES users(id)
|
||||
)');
|
||||
|
||||
DB::statement('INSERT INTO event_participants_new
|
||||
(id, event_id, player_id, user_id, status, set_by_user_id, note, responded_at, created_at, updated_at)
|
||||
SELECT id, event_id, player_id, NULL, status, set_by_user_id, note, responded_at, created_at, updated_at
|
||||
FROM event_participants');
|
||||
|
||||
DB::statement('DROP TABLE event_participants');
|
||||
DB::statement('ALTER TABLE event_participants_new RENAME TO event_participants');
|
||||
|
||||
// Indizes neu erstellen
|
||||
DB::statement('CREATE UNIQUE INDEX event_participants_event_player_unique ON event_participants(event_id, player_id)');
|
||||
DB::statement('CREATE UNIQUE INDEX event_participants_event_user_unique ON event_participants(event_id, user_id)');
|
||||
DB::statement('CREATE INDEX event_participants_event_status_idx ON event_participants(event_id, status)');
|
||||
|
||||
DB::statement('PRAGMA foreign_keys = ON');
|
||||
} else {
|
||||
// MySQL: Standard-Ansatz
|
||||
Schema::table('event_participants', function (Blueprint $table) {
|
||||
$table->foreignId('player_id')->nullable()->change();
|
||||
$table->foreignId('user_id')->nullable()->after('player_id')
|
||||
->constrained('users')->cascadeOnDelete();
|
||||
$table->unique(['event_id', 'user_id'], 'event_participants_event_user_unique');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
$driver = DB::getDriverName();
|
||||
|
||||
if ($driver === 'sqlite') {
|
||||
// Zurück zum Original-Schema (ohne user_id, player_id NOT NULL)
|
||||
DB::statement('PRAGMA foreign_keys = OFF');
|
||||
|
||||
// Bestehende Meeting-Einträge (user_id statt player_id) löschen
|
||||
DB::statement('DELETE FROM event_participants WHERE player_id IS NULL');
|
||||
|
||||
DB::statement('CREATE TABLE event_participants_old (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
event_id BIGINT UNSIGNED NOT NULL,
|
||||
player_id BIGINT UNSIGNED NOT NULL,
|
||||
status VARCHAR(20) DEFAULT \'unknown\',
|
||||
set_by_user_id BIGINT UNSIGNED NOT NULL,
|
||||
note VARCHAR(500) NULL,
|
||||
responded_at TIMESTAMP NULL,
|
||||
created_at TIMESTAMP NULL,
|
||||
updated_at TIMESTAMP NULL,
|
||||
FOREIGN KEY (event_id) REFERENCES events(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (player_id) REFERENCES players(id) ON DELETE CASCADE,
|
||||
FOREIGN KEY (set_by_user_id) REFERENCES users(id)
|
||||
)');
|
||||
|
||||
DB::statement('INSERT INTO event_participants_old
|
||||
(id, event_id, player_id, status, set_by_user_id, note, responded_at, created_at, updated_at)
|
||||
SELECT id, event_id, player_id, status, set_by_user_id, note, responded_at, created_at, updated_at
|
||||
FROM event_participants WHERE player_id IS NOT NULL');
|
||||
|
||||
DB::statement('DROP TABLE event_participants');
|
||||
DB::statement('ALTER TABLE event_participants_old RENAME TO event_participants');
|
||||
DB::statement('CREATE UNIQUE INDEX event_participants_event_player_unique ON event_participants(event_id, player_id)');
|
||||
DB::statement('CREATE INDEX event_participants_event_status_idx ON event_participants(event_id, status)');
|
||||
|
||||
DB::statement('PRAGMA foreign_keys = ON');
|
||||
} else {
|
||||
Schema::table('event_participants', function (Blueprint $table) {
|
||||
$table->dropUnique('event_participants_event_user_unique');
|
||||
$table->dropForeign(['user_id']);
|
||||
$table->dropColumn('user_id');
|
||||
$table->foreignId('player_id')->nullable(false)->change();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('teams', function (Blueprint $table) {
|
||||
$table->text('notes')->nullable()->after('is_active');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('teams', function (Blueprint $table) {
|
||||
$table->dropColumn('notes');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('team_user', function (Blueprint $table) {
|
||||
$table->foreignId('team_id')->constrained()->cascadeOnDelete();
|
||||
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
|
||||
$table->primary(['team_id', 'user_id']);
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('team_user');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('team_file', function (Blueprint $table) {
|
||||
$table->foreignId('team_id')->constrained()->cascadeOnDelete();
|
||||
$table->foreignId('file_id')->constrained()->cascadeOnDelete();
|
||||
$table->primary(['team_id', 'file_id']);
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('team_file');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('events', function (Blueprint $table) {
|
||||
$table->softDeletes();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
$table->foreign('deleted_by')->references('id')->on('users')->nullOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('events', function (Blueprint $table) {
|
||||
$table->dropForeign(['deleted_by']);
|
||||
$table->dropColumn(['deleted_at', 'deleted_by']);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->string('phone', 30)->nullable()->after('email');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('phone');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->string('dsgvo_consent_file')->nullable()->after('profile_picture');
|
||||
$table->timestamp('dsgvo_accepted_at')->nullable()->after('dsgvo_consent_file');
|
||||
$table->foreignId('dsgvo_accepted_by')->nullable()->after('dsgvo_accepted_at')
|
||||
->constrained('users')->nullOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropForeign(['dsgvo_accepted_by']);
|
||||
$table->dropColumn(['dsgvo_consent_file', 'dsgvo_accepted_at', 'dsgvo_accepted_by']);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->timestamp('dsgvo_notice_accepted_at')->nullable()->after('dsgvo_accepted_by');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('dsgvo_notice_accepted_at');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Setting;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
$locales = ['de', 'en', 'pl', 'ru', 'ar', 'tr'];
|
||||
|
||||
// Bestehende Inhalte für die Migration nach _de
|
||||
$existingImpressum = Setting::where('key', 'impressum_html')->value('value');
|
||||
$existingDatenschutz = Setting::where('key', 'datenschutz_html')->value('value');
|
||||
|
||||
foreach ($locales as $locale) {
|
||||
$entries = [
|
||||
["impressum_html_{$locale}", 'html', $locale === 'de' ? ($existingImpressum ?? '') : ''],
|
||||
["datenschutz_html_{$locale}", 'html', $locale === 'de' ? ($existingDatenschutz ?? '') : ''],
|
||||
["password_reset_email_{$locale}", 'html', ''],
|
||||
];
|
||||
|
||||
foreach ($entries as [$key, $type, $value]) {
|
||||
if (!Setting::where('key', $key)->exists()) {
|
||||
$setting = new Setting(['label' => $key, 'type' => $type, 'value' => $value]);
|
||||
$setting->key = $key;
|
||||
$setting->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
$locales = ['de', 'en', 'pl', 'ru', 'ar', 'tr'];
|
||||
|
||||
foreach ($locales as $locale) {
|
||||
Setting::where('key', "impressum_html_{$locale}")->delete();
|
||||
Setting::where('key', "datenschutz_html_{$locale}")->delete();
|
||||
Setting::where('key', "password_reset_email_{$locale}")->delete();
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user