ldc-doux/database/factories/GammeFactory.php

33 lines
892 B
PHP
Raw Normal View History

2021-12-20 17:21:09 +01:00
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use SplFileInfo;
2021-12-21 17:30:39 +01:00
use Illuminate\Support\Str;
2021-12-20 17:21:09 +01:00
class GammeFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
2021-12-22 17:32:05 +01:00
$title = $this->faker->text(10) . rand(1, 100);
2021-12-21 17:30:39 +01:00
2021-12-20 17:21:09 +01:00
return [
'parent_gamme_id' => null,
2021-12-21 17:30:39 +01:00
'title' => $title,
'slug' => Str::slug($title),
2021-12-20 17:21:09 +01:00
'text' => $this->faker->text(5),
'color' => $this->faker->hexColor(),
'picture' => new SplFileInfo(resource_path('assets/images/cookrange.jpg')),
'alt_text_picture' => $this->faker->sentence(10),
'banner' => new SplFileInfo(resource_path('assets/images/cat_bckg.jpg')),
'alt_text_banner' => $this->faker->sentence(10),
];
}
}