toby/database/factories/VacationRequestFactory.php
Adrian Hopek f3559930c2 #20 - wip
2022-01-27 09:14:08 +01:00

24 lines
578 B
PHP

<?php
declare(strict_types=1);
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Toby\Enums\VacationType;
use Toby\Models\User;
class VacationRequestFactory extends Factory
{
public function definition(): array
{
return [
"user_id" => User::factory(),
"type" => $this->faker->randomElement(VacationType::cases()),
"from" => $this->faker->date,
"to" => $this->faker->date,
"comment" => $this->faker->boolean ? $this->faker->paragraph() : null,
];
}
}