ldc-doux/database/factories/PostFactory.php

31 lines
883 B
PHP
Raw Normal View History

2021-12-17 17:27:25 +01:00
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
use SplFileInfo;
class PostFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'title' => $this->faker->text(5),
'text' => $this->faker->paragraph(10, false),
'picture_home' => new SplFileInfo(resource_path('assets/images/burger-fond.jpg')),
2021-12-20 14:02:37 +01:00
'alt_text_picture_home' => $this->faker->sentence(10),
2021-12-17 17:27:25 +01:00
'picture_news' => new SplFileInfo(resource_path('assets/images/burger.jpg')),
2021-12-20 14:02:37 +01:00
'alt_text_picture_news' => $this->faker->sentence(10),
2021-12-17 17:27:25 +01:00
'date_start' => Carbon::now(),
'date_end' => Carbon::now()->addDays(2),
2021-12-22 17:32:05 +01:00
'on_top' => true
2021-12-17 17:27:25 +01:00
];
}
}