ldc-doux/database/factories/SlideFactory.php
2021-12-07 23:35:14 +01:00

38 lines
917 B
PHP

<?php
namespace Database\Factories;
use App\Models\Slide;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
use SplFileInfo;
class SlideFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Slide::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'title' => $this->faker->unique()->word(),
'text' => $this->faker->realText(25),
'link_label' => $this->faker->text(128),
'link' => route('wasup'),
'link_new_tab' => rand(0, 1),
'date_start' => Carbon::now(),
'date_end' => Carbon::now()->addDays(2),
'picture' => new SplFileInfo(resource_path('assets/images/image-sample.jpg'))
];
}
}