- Event-Medien tragen Typ (image/video/audio), Dauer und Notiz; Videos bekommen ein Poster, Audio wird per ffmpeg nach AAC (audio/mp4) gewandelt, Originale werden mit Range-Unterstützung gestreamt. - Upload nimmt eine Notiz (caption) direkt mit, PATCH ändert sie später. - Neue Event-Felder: Zeitraum (end_date), Kategorie, Personen, Meilenstein. Regeln zentral in EventFields, damit CRUD und Sync gleich prüfen. - Titel darf leer sein: ein Event entsteht mit dem ersten Eintrag. - Artisan-Befehl media:transcode-voice-notes wandelt alte WebM/Ogg-Notizen, die Safari nicht abspielen kann. - Login-Throttling, Settings-Validierung, Sync-Fehlercodes ohne Rohtext. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
32 lines
905 B
PHP
32 lines
905 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Str;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Event>
|
|
*/
|
|
class EventFactory extends Factory
|
|
{
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'client_id' => Str::uuid()->toString(),
|
|
'user_id' => User::factory(),
|
|
'title' => fake()->sentence(3),
|
|
'date' => fake()->date(),
|
|
'end_date' => null,
|
|
'category' => null,
|
|
'people' => null,
|
|
'emotion' => fake()->randomFloat(3, -1, 1),
|
|
'milestone' => false,
|
|
'custom_color' => null,
|
|
'gradient_preset' => fake()->optional(0.3)->numberBetween(0, 9),
|
|
'image' => null,
|
|
'note' => fake()->optional(0.5)->sentence(),
|
|
];
|
|
}
|
|
}
|