37 lines
994 B
PHP
37 lines
994 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\SubRange;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
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()
|
|
{
|
|
$title = $this->faker->unique()->words(rand(2, 5), true);
|
|
return [
|
|
'name' => $title,
|
|
'picture' => null,
|
|
'picture_alt' => null,
|
|
'back_link_display' => (bool)rand(0, 1),
|
|
'back_link_text' => 'En savoir +',
|
|
'back_link_url' => '/on-s-engage/le-gaulois-marque-engagee-et-responsable/bien-nourrir-tous-les-francais',
|
|
'title' => $this->faker->words(6, true),
|
|
'subtitle' => $this->faker->words(10, true),
|
|
'content' => $this->faker->text(1500)
|
|
];
|
|
}
|
|
}
|