2025-07-24 11:32:12 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Database\Factories;
|
|
|
|
|
|
2025-07-28 09:46:22 +02:00
|
|
|
use App\Enums\Claims\ClaimResponseType;
|
2025-07-24 11:32:12 +02:00
|
|
|
use App\Enums\Claims\ClaimStatus;
|
|
|
|
|
use App\Enums\Claims\ClaimType;
|
|
|
|
|
use App\Models\Brand;
|
|
|
|
|
use App\Models\Claim;
|
|
|
|
|
use App\Models\ClaimSubject;
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
|
|
|
|
|
|
class ClaimFactory extends Factory
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* The name of the factory's corresponding model.
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
protected $model = Claim::class;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Define the model's default state.
|
|
|
|
|
*
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
public function definition(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
2025-07-28 09:46:22 +02:00
|
|
|
'first_name' => $this->faker->firstName(),
|
|
|
|
|
'last_name' => $this->faker->lastName(),
|
|
|
|
|
'email' => $this->faker->email(),
|
|
|
|
|
'address' => $this->faker->optional()->address(),
|
|
|
|
|
'city' => $this->faker->optional()->city(),
|
|
|
|
|
'postcode' => $this->faker->optional()->postcode(),
|
|
|
|
|
'message' => $this->faker->sentence(10),
|
|
|
|
|
'response_type' => ClaimResponseType::none,
|
|
|
|
|
'type' => collect(ClaimType::toArray())->random()->value,
|
|
|
|
|
'status' => collect(ClaimStatus::toArray())->random()->value,
|
2025-08-05 09:23:54 +02:00
|
|
|
'brand_id' => $this->faker->randomElement(Brand::query()->get()->modelKeys()),
|
|
|
|
|
'subject_id' => $this->faker->randomElement(ClaimSubject::query()->get()->modelKeys()),
|
2025-07-24 11:32:12 +02:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|