Add initial Todo items and CalDAV sync

This commit is contained in:
2025-12-02 17:32:52 +01:00
parent 2e440edc61
commit a4466a9d2c
18 changed files with 1112 additions and 114 deletions
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace Database\Factories;
use App\Models\Todo;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
class TodoFactory extends Factory
{
protected $model = Todo::class;
public function definition(): array
{
$now = $this->faker->dateTimeBetween('-1 month', 'now');
return [
'id' => (string) Str::uuid(),
'etag' => null,
'title' => $this->faker->sentence(4),
'description' => $this->faker->optional()->paragraph(),
'type_id' => null,
'url' => $this->faker->optional()->url(),
'due_date' => $this->faker->optional()->dateTimeBetween('now', '+2 months'),
'recurring' => $this->faker->optional()->regexify('RRULE:FREQ=DAILY;COUNT=\d{1,2}'),
'priority' => $this->faker->optional()->numberBetween(1, 9),
'status' => $this->faker->randomElement(['NEEDS-ACTION','IN-PROCESS','COMPLETED', null]),
'created_at' => $now,
'last_modified' => $this->faker->dateTimeBetween($now, 'now'),
'parent' => null,
'object' => null,
];
}
}