journal-intime/database/factories/PostFactory.php

17 lines
485 B
PHP
Raw Normal View History

<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\Model;
use Faker\Generator as Faker;
$factory->define(\App\Post::class, function (Faker $faker) {
return [
'user_id' => 1,
'date_post' => $faker->dateTimeBetween('-1 year'),
// 'date_post' => \Carbon\Carbon::createFromFormat('Y-n-d', rand(2018,2019), rand(1,12), rand(1,28)),
'content' => $faker->sentences(3, true),
'created_at' => \Carbon\Carbon::now()
];
});