first commit

This commit is contained in:
Noor E Ilahi
2026-01-09 12:54:53 +05:30
commit 7ccf44f7da
1070 changed files with 113036 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
<?php
namespace Database\Factories;
use App\Enums\Role;
use App\Models\Priority;
use App\Models\Status;
use App\Models\Task;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Factories\Factory;
class TaskFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Task::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition(): array
{
return [
'task_name' => fake()->sentence(3),
'description' => fake()->paragraph,
'assigned_by' => fn() => User::where(['role_id' => Role::ADMIN])->first()->id,
'important' => fake()->boolean,
'priority_id' => Priority::inRandomOrder()->first()->id,
'status_id' => Status::inRandomOrder()->first()->id,
'start_date' => fake()->optional(0.8)->passthrough(Carbon::now()),
'due_date' => fake()->optional(0.8)->passthrough(Carbon::now()->addDays(fake()->numberBetween(1, 40))),
];
}
}