35 lines
694 B
PHP
35 lines
694 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Slider;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Str;
|
|
|
|
class SliderFactory extends Factory
|
|
{
|
|
|
|
/**
|
|
* The name of the factory's corresponding model.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $model = Slider::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function definition()
|
|
{
|
|
$label = $this->faker->unique()->word();
|
|
|
|
return [
|
|
'label' => $label,
|
|
'slug' => Str::slug($label),
|
|
'commentaire' => $this->faker->realText(128),
|
|
'published' => rand(0, 1)
|
|
];
|
|
}
|
|
}
|