first commit;
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-09-17 23:01:26 -07:00
commit 1e8ae3d1e5
137 changed files with 24339 additions and 0 deletions
+82
View File
@@ -0,0 +1,82 @@
<?php
namespace Database\Factories;
use App\Models\Folder;
use App\Models\Todo;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<Todo>
*/
class TodoFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'user_id' => User::factory(),
'folder_id' => Folder::factory(),
'description' => fake()->sentence(6),
'due_date' => today()->addDays(5),
'completed_at' => null,
];
}
/**
* Indicate that the todo has no due date.
*/
public function noDueDate(): static
{
return $this->state(fn (array $attributes) => [
'due_date' => null,
]);
}
/**
* Indicate that the todo has notes.
*/
public function withNotes(): static
{
return $this->state(fn (array $attributes) => [
'notes' => fake()->paragraph(),
]);
}
/**
* Indicate that the todo has been completed.
*/
public function completed(): static
{
return $this->state(fn (array $attributes) => [
'completed_at' => now(),
]);
}
/**
* Indicate that the todo is overdue.
*/
public function overdue(): static
{
return $this->state(fn (array $attributes) => [
'due_date' => today()->subDays(3),
'completed_at' => null,
]);
}
/**
* Indicate that the todo is due today and still open.
*/
public function dueToday(): static
{
return $this->state(fn (array $attributes) => [
'due_date' => today(),
'completed_at' => null,
]);
}
}