Commit the Projects/Tasks/Ideas/TaskComments feature
This was already implemented, migrated, and running live, but had never been committed. Bringing it into git: Project/Task/Idea/ TaskComment models, their JSON API (CRUD + status transitions, task comments, idea<->project linking), Livewire UI pages, and the nav/route wiring for them. All 42 of its own tests pass. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Project;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class ProjectFactory extends Factory
|
||||
{
|
||||
protected $model = Project::class;
|
||||
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->words(2, true),
|
||||
'description' => fake()->optional()->paragraph(),
|
||||
'status' => fake()->randomElement(Project::STATUSES),
|
||||
'due_at' => fake()->optional()->dateTimeBetween('now', '+1 year'),
|
||||
];
|
||||
}
|
||||
|
||||
public function active(): static
|
||||
{
|
||||
return $this->state(fn () => [
|
||||
'status' => 'active',
|
||||
]);
|
||||
}
|
||||
|
||||
public function completed(): static
|
||||
{
|
||||
return $this->state(fn () => [
|
||||
'status' => 'completed',
|
||||
]);
|
||||
}
|
||||
|
||||
public function archived(): static
|
||||
{
|
||||
return $this->state(fn () => [
|
||||
'status' => 'archived',
|
||||
]);
|
||||
}
|
||||
|
||||
public function onHold(): static
|
||||
{
|
||||
return $this->state(fn () => [
|
||||
'status' => 'on_hold',
|
||||
]);
|
||||
}
|
||||
|
||||
public function planned(): static
|
||||
{
|
||||
return $this->state(fn () => [
|
||||
'status' => 'planned',
|
||||
]);
|
||||
}
|
||||
|
||||
public function withDueDate(): static
|
||||
{
|
||||
return $this->state(fn () => [
|
||||
'due_at' => fake()->dateTimeBetween('now', '+1 year'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user