2018-04-12 09:01:41 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Faker\Generator as Faker;
|
|
|
|
|
|
|
|
$factory->define(App\Models\News::class, function (Faker $faker) {
|
|
|
|
return [
|
|
|
|
'id' => null,
|
2018-08-27 00:40:04 +08:00
|
|
|
'user_id' => function () {
|
2018-04-12 09:01:41 +08:00
|
|
|
return factory(App\Models\User::class)->create()->id;
|
|
|
|
},
|
|
|
|
'subject' => $faker->text(),
|
|
|
|
'body' => $faker->sentence,
|
|
|
|
];
|
|
|
|
});
|