die tenant admin oauth authentifizierung wurde implementiert und funktioniert jetzt. Zudem wurde das marketing frontend dashboard implementiert.
This commit is contained in:
@@ -2,18 +2,20 @@
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Emotion;
|
||||
use App\Models\Task;
|
||||
use App\Models\Tenant;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
use App\Models\{Emotion, Task, Tenant};
|
||||
|
||||
class EventTasksSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
// Get demo tenant
|
||||
$demoTenant = Tenant::where('slug', 'demo')->first();
|
||||
if (!$demoTenant) {
|
||||
$demoTenant = Tenant::where('slug', 'demo-tenant')->first();
|
||||
if (! $demoTenant) {
|
||||
$this->command->info('Demo tenant not found, skipping EventTasksSeeder');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -198,14 +200,17 @@ class EventTasksSeeder extends Seeder
|
||||
];
|
||||
|
||||
// Difficulty rotation
|
||||
$difficulties = ['easy','easy','medium','easy','medium','hard'];
|
||||
$difficulties = ['easy', 'easy', 'medium', 'easy', 'medium', 'hard'];
|
||||
|
||||
foreach (Emotion::all() as $emotion) {
|
||||
$name = is_array($emotion->name) ? ($emotion->name['de'] ?? array_values($emotion->name)[0]) : (string) $emotion->name;
|
||||
$list = $catalog[$name] ?? null;
|
||||
if (!$list) continue; // skip unknown emotion labels
|
||||
if (! $list) {
|
||||
continue;
|
||||
} // skip unknown emotion labels
|
||||
|
||||
$created = 0; $order = 1;
|
||||
$created = 0;
|
||||
$order = 1;
|
||||
foreach ($list as $i => $row) {
|
||||
[$deTitle, $deDesc, $enTitle, $enDesc] = $row;
|
||||
|
||||
@@ -213,7 +218,11 @@ class EventTasksSeeder extends Seeder
|
||||
$exists = Task::where('emotion_id', $emotion->id)
|
||||
->where('title->de', $deTitle)
|
||||
->exists();
|
||||
if ($exists) { $order++; continue; }
|
||||
if ($exists) {
|
||||
$order++;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
Task::create([
|
||||
'tenant_id' => $demoTenant->id,
|
||||
@@ -233,7 +242,7 @@ class EventTasksSeeder extends Seeder
|
||||
$i = 0;
|
||||
while ($created < 20 && $i < count($list)) {
|
||||
[$deTitle, $deDesc, $enTitle, $enDesc] = $list[$i];
|
||||
$suffix = ' #' . ($created + 1);
|
||||
$suffix = ' #'.($created + 1);
|
||||
Task::create([
|
||||
'tenant_id' => $demoTenant->id,
|
||||
'emotion_id' => $emotion->id,
|
||||
@@ -245,9 +254,9 @@ class EventTasksSeeder extends Seeder
|
||||
'sort_order' => $order++,
|
||||
'is_active' => true,
|
||||
]);
|
||||
$created++; $i++;
|
||||
$created++;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user