2021-12-19 18:38:42 +01:00
|
|
|
<?php
|
|
|
|
|
2023-02-03 20:41:59 +01:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2021-12-19 18:38:42 +01:00
|
|
|
namespace Database\Factories\Engelsystem\Models\User;
|
|
|
|
|
|
|
|
use Engelsystem\Models\User\License;
|
2023-10-24 23:00:04 +02:00
|
|
|
use Engelsystem\Models\User\User;
|
2021-12-19 18:38:42 +01:00
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
|
|
|
|
class LicenseFactory extends Factory
|
|
|
|
{
|
|
|
|
/** @var string */
|
2022-12-15 19:50:56 +01:00
|
|
|
protected $model = License::class; // phpcs:ignore
|
2021-12-19 18:38:42 +01:00
|
|
|
|
2022-12-14 19:15:20 +01:00
|
|
|
public function definition(): array
|
2021-12-19 18:38:42 +01:00
|
|
|
{
|
|
|
|
$drive_car = $this->faker->boolean(.8);
|
|
|
|
$drive_3_5t = $drive_car && $this->faker->boolean(.7);
|
|
|
|
$drive_7_5t = $drive_3_5t && $this->faker->boolean();
|
|
|
|
$drive_12t = $drive_7_5t && $this->faker->boolean(.3);
|
|
|
|
$drive_forklift = ($drive_car && $this->faker->boolean(.1))
|
|
|
|
|| ($drive_12t && $this->faker->boolean(.7));
|
|
|
|
|
2023-08-12 12:00:46 +02:00
|
|
|
$ifsg_certificate = $this->faker->boolean(0.1);
|
|
|
|
$ifsg_certificate_light = $this->faker->boolean(0.5) && !$ifsg_certificate;
|
2024-03-05 17:42:38 +01:00
|
|
|
$ifsg_confirmed = $this->faker->boolean(0.5) && ($ifsg_certificate || $ifsg_certificate_light);
|
2023-08-12 12:00:46 +02:00
|
|
|
|
2021-12-19 18:38:42 +01:00
|
|
|
return [
|
2023-10-24 23:00:04 +02:00
|
|
|
'user_id' => User::factory(),
|
2023-08-12 12:00:46 +02:00
|
|
|
'has_car' => $drive_car && $this->faker->boolean(.7),
|
|
|
|
'drive_forklift' => $drive_forklift,
|
|
|
|
'drive_car' => $drive_car,
|
|
|
|
'drive_3_5t' => $drive_3_5t,
|
|
|
|
'drive_7_5t' => $drive_7_5t,
|
|
|
|
'drive_12t' => $drive_12t,
|
|
|
|
'ifsg_certificate' => $ifsg_certificate,
|
|
|
|
'ifsg_certificate_light' => $ifsg_certificate_light,
|
2024-03-05 17:42:38 +01:00
|
|
|
'ifsg_confirmed' => $ifsg_confirmed,
|
2021-12-19 18:38:42 +01:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|