ldc-legaulois/database/factories/SubRangesFactory.php
Jérémy Munsch 5be40abc2e
add back_link_display to subranges
add subrange infos on product index
2021-09-24 16:08:47 +02:00

32 lines
1.1 KiB
PHP

<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\Models\SubRange;
use Faker\Generator as Faker;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/
$factory->define(SubRange::class, function (Faker $faker) {
$title = $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' => $faker->words(6, true),
'subtitle' => $faker->words(10, true),
'content' => $faker->text(1500)
];
});