ldc-nature-and-respect/database/factories/RangeFactory.php

40 lines
873 B
PHP
Raw Normal View History

2023-03-16 09:47:16 +01:00
<?php
namespace Database\Factories;
2023-03-20 10:47:44 +01:00
use App\Enums\Ranges\PictoEnum;
2023-03-16 09:47:16 +01:00
use App\Models\Range;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
/**
* @extends Factory<\App\Models\Range>
*/
final class RangeFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Range::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition(): array
{
$label = fake()->unique()->word;
return [
'seo_title' => fake()->word,
'seo_description' => fake()->text,
'label' => $label,
'slug' => Str::slug($label),
2023-03-20 10:47:44 +01:00
'picto' => \collect(PictoEnum::cases())->random(),
2023-03-16 09:47:16 +01:00
'status' => fake()->boolean(75),
];
}
}