Generate model factories

This commit is contained in:
Laravel Shift
2020-01-22 17:19:00 +00:00
parent a2df254cb7
commit 69e87ee1d4
49 changed files with 372 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
<?php
/* @var $factory \Illuminate\Database\Eloquent\Factory */
use Faker\Generator as Faker;
$factory->define(App\Models\Topic::class, function (Faker $faker) {
return [
'forum_id' => function () {
return factory(App\Models\Forum::class)->create()->id;
},
'first_post_user_id' => function () {
return factory(App\Models\User::class)->create()->id;
},
];
});