ldc-le-gaulois-pro/database/factories/RangeFactory.php

39 lines
1.1 KiB
PHP

<?php
namespace Database\Factories;
use App\Models\Range;
use Illuminate\Support\Str;
use Illuminate\Database\Eloquent\Factories\Factory;
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()
{
$label = $this->faker->unique()->words(rand(2, 4), true);
return [
'label' => $label,
'slug' => Str::slug($label),
'seo_title' => $this->faker->words(8, true),
'seo_description' => $this->faker->words(25, true),
'color' => $this->faker->unique()->rgbCssColor(),
'picture_alt' => $this->faker->unique()->words(rand(5, 6), true),
'picture_title' => $this->faker->unique()->words(rand(2, 4), true),
'picture_banner_alt' => $this->faker->unique()->words(rand(5, 6), true),
'picture_banner_title' => $this->faker->unique()->words(rand(2, 4), true),
];
}
}