23-01-2026
This commit is contained in:
parent
07959c0ba2
commit
854ce02bf6
166 changed files with 32909 additions and 1262 deletions
|
|
@ -19,6 +19,7 @@ return new class extends Migration
|
|||
$table->string('slug')->unique();
|
||||
$table->string('logo_url')->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->boolean('is_active')->default(true);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
<?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('registration_codes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('code')->unique();
|
||||
$table->string('role'); // broker|customer|retailer|manufacturer
|
||||
$table->string('status')->default('available'); // available|used|expired
|
||||
$table->foreignId('broker_partner_id')->nullable()->constrained('partners')->nullOnDelete();
|
||||
$table->foreignId('partner_id')->nullable()->constrained('partners')->nullOnDelete();
|
||||
$table->foreignId('used_by_user_id')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->timestamp('used_at')->nullable();
|
||||
$table->timestamp('expires_at')->nullable();
|
||||
$table->json('metadata')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['role', 'status']);
|
||||
$table->index('broker_partner_id');
|
||||
$table->index('partner_id');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('registration_codes');
|
||||
}
|
||||
};
|
||||
|
|
@ -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('registration_codes', function (Blueprint $table) {
|
||||
$table->string('name')->nullable()->after('role');
|
||||
$table->foreignId('assigned_to_code_id')->nullable()->after('broker_partner_id')->constrained('registration_codes')->nullOnDelete();
|
||||
|
||||
// Indizes für bessere Performance
|
||||
$table->index('name');
|
||||
$table->index('assigned_to_code_id');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('registration_codes', function (Blueprint $table) {
|
||||
$table->dropIndex(['name']);
|
||||
$table->dropIndex(['assigned_to_code_id']);
|
||||
$table->dropForeign(['assigned_to_code_id']);
|
||||
$table->dropColumn(['name', 'assigned_to_code_id']);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?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('roles', function (Blueprint $table) {
|
||||
$table->string('reg_prefix', 1)->nullable()->after('can_be_invited');
|
||||
$table->string('reg_description')->nullable()->after('reg_prefix');
|
||||
$table->integer('reg_start_number')->nullable()->after('reg_description');
|
||||
|
||||
// Index für Prefix-Suche
|
||||
$table->index('reg_prefix');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('roles', function (Blueprint $table) {
|
||||
$table->dropIndex(['reg_prefix']);
|
||||
$table->dropColumn(['reg_prefix', 'reg_description', 'reg_start_number']);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -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
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
// Name für die Zuordnung von Kunden (für Makler, Händler, Hersteller)
|
||||
$table->string('display_name')->nullable()->after('name');
|
||||
$table->index('display_name');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropIndex(['display_name']);
|
||||
$table->dropColumn('display_name');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* Hinweis: Diese Spalte wurde später in parent_partner_id umbenannt.
|
||||
* Siehe Migration: 2025_12_17_123422_rename_broker_partner_id_to_parent_partner_id_in_partners_table
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('partners', function (Blueprint $table) {
|
||||
// Für Kunden: Verknüpfung zum zugeordneten Makler/Händler
|
||||
// Wird später zu parent_partner_id umbenannt
|
||||
$table->foreignId('broker_partner_id')
|
||||
->nullable()
|
||||
->after('hub_id')
|
||||
->constrained('partners')
|
||||
->nullOnDelete();
|
||||
|
||||
$table->index('broker_partner_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('partners', function (Blueprint $table) {
|
||||
$table->dropIndex(['broker_partner_id']);
|
||||
$table->dropForeign(['broker_partner_id']);
|
||||
$table->dropColumn('broker_partner_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -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('partners', function (Blueprint $table) {
|
||||
// Umbenennen der Spalte für generische Verwendung
|
||||
// (sowohl für Makler/Estate-Agent als auch Händler/Retailer)
|
||||
$table->renameColumn('broker_partner_id', 'parent_partner_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('partners', function (Blueprint $table) {
|
||||
$table->renameColumn('parent_partner_id', 'broker_partner_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<?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('partners', function (Blueprint $table) {
|
||||
// Brand/Theme speichern für Wiedererkennung im Portal
|
||||
// Werte: b2in, b2a, stileigentum, style2own
|
||||
$table->string('brand')->nullable()->after('type');
|
||||
|
||||
$table->index('brand');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('partners', function (Blueprint $table) {
|
||||
$table->dropIndex(['brand']);
|
||||
$table->dropColumn('brand');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
<?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('partners', function (Blueprint $table) {
|
||||
// Kontaktdaten und Adresse
|
||||
$table->string('salutation')->nullable()->after('brand'); // Herr, Frau, Divers
|
||||
$table->string('first_name')->nullable()->after('salutation');
|
||||
$table->string('last_name')->nullable()->after('first_name');
|
||||
$table->string('street')->nullable()->after('description');
|
||||
$table->string('house_number')->nullable()->after('street');
|
||||
$table->string('zip')->nullable()->after('house_number');
|
||||
$table->string('city')->nullable()->after('zip');
|
||||
$table->string('country')->default('Deutschland')->after('city');
|
||||
$table->string('phone')->nullable()->after('country');
|
||||
$table->string('website')->nullable()->after('phone');
|
||||
|
||||
// Display Name für Broker (kann vom Firmennamen abweichen)
|
||||
$table->string('display_name')->nullable()->after('company_name');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('partners', function (Blueprint $table) {
|
||||
$table->dropColumn([
|
||||
'salutation',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'street',
|
||||
'house_number',
|
||||
'zip',
|
||||
'city',
|
||||
'country',
|
||||
'phone',
|
||||
'website',
|
||||
'display_name',
|
||||
]);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<?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('users', function (Blueprint $table) {
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropSoftDeletes();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -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
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('brands', function (Blueprint $table) {
|
||||
$table->foreignId('partner_id')->after('id')->nullable()->constrained('partners')->nullOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('brands', function (Blueprint $table) {
|
||||
$table->dropForeign(['partner_id']);
|
||||
$table->dropColumn('partner_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -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
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('display_videos', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('filename'); // Dateiname des Videos (z.B. herbst_2025.mp4)
|
||||
$table->string('title')->nullable(); // Optionaler Titel für bessere Verwaltung
|
||||
$table->integer('position')->default(25); // Position in % (0-100)
|
||||
$table->integer('sort_order')->default(0); // Reihenfolge der Wiedergabe
|
||||
$table->boolean('is_active')->default(true); // Aktiv/Inaktiv
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('display_videos');
|
||||
}
|
||||
};
|
||||
|
|
@ -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
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('display_footer_contents', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('headline'); // Überschrift (z.B. "Beratung & Termin")
|
||||
$table->string('subline'); // Unterzeile (z.B. "Jetzt Termin vereinbaren.")
|
||||
$table->string('url'); // URL für den QR-Code
|
||||
$table->integer('sort_order')->default(0); // Reihenfolge der Anzeige
|
||||
$table->boolean('is_active')->default(true); // Aktiv/Inaktiv
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('display_footer_contents');
|
||||
}
|
||||
};
|
||||
|
|
@ -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
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('display_footer_contents', function (Blueprint $table) {
|
||||
$table->string('short_code', 10)->unique()->nullable()->after('url');
|
||||
$table->unsignedInteger('clicks')->default(0)->after('short_code');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('display_footer_contents', function (Blueprint $table) {
|
||||
$table->dropColumn(['short_code', 'clicks']);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -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('display_footer_contents', function (Blueprint $table) {
|
||||
$table->string('url')->nullable()->change();
|
||||
$table->string('short_code', 10)->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('display_footer_contents', function (Blueprint $table) {
|
||||
$table->string('url')->nullable(false)->change();
|
||||
$table->string('short_code', 10)->nullable(false)->change();
|
||||
});
|
||||
}
|
||||
};
|
||||
68
database/seeders/DisplayContentSeeder.php
Normal file
68
database/seeders/DisplayContentSeeder.php
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\DisplayVideo;
|
||||
use App\Models\DisplayFooterContent;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DisplayContentSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// Videos aus der bestehenden Konfiguration
|
||||
$videos = [
|
||||
['filename' => 'herbst_2025.mp4', 'title' => 'Herbst 2025', 'position' => 25, 'sort_order' => 0],
|
||||
['filename' => 'fruehjahr_2025.mp4', 'title' => 'Frühjahr 2025', 'position' => 10, 'sort_order' => 1],
|
||||
['filename' => 'fruehjahr_2024.mp4', 'title' => 'Frühjahr 2024', 'position' => 25, 'sort_order' => 2],
|
||||
['filename' => 'herbst_2024.mp4', 'title' => 'Herbst 2024', 'position' => 25, 'sort_order' => 3],
|
||||
];
|
||||
|
||||
foreach ($videos as $video) {
|
||||
DisplayVideo::create($video);
|
||||
}
|
||||
|
||||
// Footer-Inhalte aus der bestehenden Konfiguration
|
||||
$footerContents = [
|
||||
[
|
||||
'headline' => 'Beratung & Termin',
|
||||
'subline' => 'Jetzt Termin vereinbaren.',
|
||||
'url' => 'https://www.cabinet.de/bielefeld?utm_source=store_display&utm_medium=qr_code&utm_campaign=bielefeld_pos&utm_content=termin_buchung#c39393',
|
||||
'sort_order' => 0,
|
||||
],
|
||||
[
|
||||
'headline' => 'Beratung vor Ort',
|
||||
'subline' => 'Einfach reinkommen.',
|
||||
'url' => 'https://www.cabinet.de/bielefeld?utm_source=store_display&utm_medium=qr_code&utm_campaign=bielefeld_pos&utm_content=termin_buchung#c39393',
|
||||
'sort_order' => 1,
|
||||
],
|
||||
[
|
||||
'headline' => 'Pinterest',
|
||||
'subline' => 'Inspirationen entdecken.',
|
||||
'url' => 'https://de.pinterest.com/cabinet_AG/',
|
||||
'sort_order' => 2,
|
||||
],
|
||||
[
|
||||
'headline' => 'Instagram',
|
||||
'subline' => 'Tägliche Einblicke & Design.',
|
||||
'url' => 'https://www.instagram.com/cabinet_schranksysteme/',
|
||||
'sort_order' => 3,
|
||||
],
|
||||
[
|
||||
'headline' => 'Facebook',
|
||||
'subline' => 'News, Aktionen & Community.',
|
||||
'url' => 'https://de-de.facebook.com/cabinetschranksysteme/',
|
||||
'sort_order' => 4,
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($footerContents as $content) {
|
||||
DisplayFooterContent::create($content);
|
||||
}
|
||||
|
||||
$this->command->info('Display-Inhalte erfolgreich eingefügt!');
|
||||
}
|
||||
}
|
||||
|
|
@ -65,7 +65,10 @@ class RoleSeeder extends Seeder
|
|||
'display_name' => 'Customer (Kunde)',
|
||||
'icon' => 'user',
|
||||
'color' => 'indigo',
|
||||
'can_be_invited' => true
|
||||
'can_be_invited' => true,
|
||||
'reg_prefix' => 'K',
|
||||
'reg_description' => 'Kundencodes werden Maklern oder Händlern zugeordnet',
|
||||
'reg_start_number' => 10000000,
|
||||
]);
|
||||
$customerRole->givePermissionTo([
|
||||
'view products',
|
||||
|
|
@ -79,7 +82,10 @@ class RoleSeeder extends Seeder
|
|||
'display_name' => 'Estate-Agent (Makler)',
|
||||
'icon' => 'home',
|
||||
'color' => 'lime',
|
||||
'can_be_invited' => true
|
||||
'can_be_invited' => true,
|
||||
'reg_prefix' => 'M',
|
||||
'reg_description' => 'Maklercodes für die Registrierung von Maklern',
|
||||
'reg_start_number' => 10000000,
|
||||
]);
|
||||
$estateAgentRole->givePermissionTo([
|
||||
'access dashboard',
|
||||
|
|
@ -94,7 +100,10 @@ class RoleSeeder extends Seeder
|
|||
'display_name' => 'Retailer (Händler)',
|
||||
'icon' => 'building-storefront',
|
||||
'color' => 'teal',
|
||||
'can_be_invited' => true
|
||||
'can_be_invited' => true,
|
||||
'reg_prefix' => 'H',
|
||||
'reg_description' => 'Händlercodes für die Registrierung von Händlern',
|
||||
'reg_start_number' => 10000000,
|
||||
]);
|
||||
$retailerRole->givePermissionTo([
|
||||
'access dashboard',
|
||||
|
|
@ -113,7 +122,10 @@ class RoleSeeder extends Seeder
|
|||
'display_name' => 'Manufacturer (Hersteller)',
|
||||
'icon' => 'wrench-screwdriver',
|
||||
'color' => 'orange',
|
||||
'can_be_invited' => true
|
||||
'can_be_invited' => true,
|
||||
'reg_prefix' => 'P',
|
||||
'reg_description' => 'Herstellercodes für die Registrierung von Herstellern',
|
||||
'reg_start_number' => 10000000,
|
||||
]);
|
||||
$manufacturerRole->givePermissionTo([
|
||||
'access dashboard',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue