53 lines
2.1 KiB
PHP
53 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Enums\Breeders\GeoType;
|
|
use App\Enums\Breeders\OCBStatus;
|
|
use App\Enums\Breeders\OCBType;
|
|
use App\Enums\Department;
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class BreederFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
$code = strval(fake()->numberBetween(1, 1000));
|
|
$lastname = fake()->lastname();
|
|
$firstname = fake()->firstName();
|
|
return [
|
|
'breeder_code' => $code,
|
|
'inuav_codes' => [
|
|
fake()->text(10),
|
|
fake()->text(10),
|
|
],
|
|
'slug' => sprintf("%s-%s-%s", $code, $lastname, $firstname),
|
|
'first_name' => $firstname,
|
|
'last_name' => fake()->lastName(),
|
|
'picture' => '',
|
|
'picture_title' => fake()->words(5, true),
|
|
'picture_alt' => fake()->words(8, true),
|
|
'postal_code' => fake()->postcode(),
|
|
'department' => \collect(Department::toArray())->random()->value,
|
|
'place' => fake()->word(),
|
|
'testimony' => fake()->text(),
|
|
'latitude' => fake()->randomFloat(2),
|
|
'longitude' => fake()->randomFloat(2),
|
|
'geo_type' => \collect(GeoType::toArray())->random()->value,
|
|
'ocbStatus' => \collect(OCBStatus::toArray())->random()->value,
|
|
'ocbType' => \collect(OCBType::toArray())->random()->value,
|
|
'audit' => 1, // FIXME: utilité de ce champs, aucune indication
|
|
'valid_marketing_date' => Carbon::now(),
|
|
'approaches' => [],
|
|
'is_highlighted' => fake()->boolean(75),
|
|
'order' => 1,
|
|
'published' => fake()->boolean(75),
|
|
];
|
|
}
|
|
}
|