ldc-lionor/database/factories/RangeFactory.php
2023-02-24 15:20:58 +00:00

46 lines
1.5 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()
{
$name = $this->faker->unique()->words((int)$this->faker->randomFloat(0, 5, 6), true);
return [
'name' => $name,
'slug' => Str::slug($name),
'subtitle' => $this->faker->unique()->sentence(),
'seo_title' => $this->faker->words(8, true),
'seo_description' => $this->faker->words(20, true),
'picture_alt' => $this->faker->unique()->words((int)$this->faker->randomFloat(0, 5, 6), true),
'picture_title' => $this->faker->unique()->words((int)$this->faker->randomFloat(0, 2, 4), true),
'banner_alt' => $this->faker->unique()->words((int)$this->faker->randomFloat(0, 5, 6), true),
'banner_title' => $this->faker->unique()->words((int)$this->faker->randomFloat(0, 2, 4), true),
'sticker_alt' => $this->faker->unique()->words((int)$this->faker->randomFloat(0, 5, 6), true),
'sticker_title' => $this->faker->unique()->words((int)$this->faker->randomFloat(0, 2, 4), true),
'status' => $this->faker->boolean(75)
];
}
}