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

34 lines
657 B
PHP
Raw Normal View History

<?php
namespace Database\Factories;
use App\Models\Subrange;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
class SubrangeFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Subrange::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),
'range_id' => rand(1, 5)
];
}
}