tenant admin startseite schicker gestaltet und super-admin und tenant admin (filament) aufgesplittet.

Es gibt nun task collections und vordefinierte tasks für alle. Onboarding verfeinert und webseite-carousel gefixt (logging später entfernen!)
This commit is contained in:
Codex Agent
2025-10-14 15:17:52 +02:00
parent 64a5411fb9
commit 1a4bdb1fe1
92 changed files with 6027 additions and 515 deletions

View File

@@ -2,9 +2,12 @@
namespace Database\Factories;
use App\Models\EventType;
use App\Models\Task;
use App\Models\TaskCollection;
use App\Models\Tenant;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
class TaskCollectionFactory extends Factory
{
@@ -12,13 +15,21 @@ class TaskCollectionFactory extends Factory
public function definition(): array
{
$categories = ['Allgemein', 'Vorbereitung', 'Event-Tag', 'Aufräumen', 'Follow-up'];
$colors = ['#3B82F6', '#10B981', '#F59E0B', '#EF4444', '#8B5CF6'];
$label = ucfirst($this->faker->unique()->words(2, true));
$description = $this->faker->sentence(12);
return [
'tenant_id' => Tenant::factory(),
'name' => $this->faker->randomElement($categories),
'description' => $this->faker->sentence(),
'event_type_id' => EventType::factory(),
'slug' => Str::slug($label . '-' . $this->faker->unique()->numberBetween(1, 9999)),
'name_translations' => [
'de' => $label,
'en' => $label,
],
'description_translations' => [
'de' => $description,
'en' => $description,
],
'is_default' => $this->faker->boolean(20),
'position' => $this->faker->numberBetween(1, 10),
];
@@ -28,7 +39,10 @@ class TaskCollectionFactory extends Factory
{
return $this->afterCreating(function (TaskCollection $collection) use ($count) {
\App\Models\Task::factory($count)
->create(['tenant_id' => $collection->tenant_id])
->create([
'tenant_id' => $collection->tenant_id,
'event_type_id' => $collection->event_type_id,
])
->each(function ($task) use ($collection) {
$task->taskCollection()->associate($collection);
$task->save();
@@ -43,4 +57,4 @@ class TaskCollectionFactory extends Factory
'position' => 1,
]);
}
}
}