39 lines
873 B
PHP
39 lines
873 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Enums\Ranges\PictoEnum;
|
|
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),
|
|
'picto' => \collect(PictoEnum::cases())->random(),
|
|
'status' => fake()->boolean(75),
|
|
];
|
|
}
|
|
}
|