You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
461 B
21 lines
461 B
<?php |
|
|
|
namespace Tests\Seeds; |
|
|
|
use Illuminate\Database\Seeder; |
|
use Tests\Models\Profile; |
|
use Tests\Models\Tag; |
|
use Tests\Models\User; |
|
|
|
class UserTableSeeder extends Seeder |
|
{ |
|
public function run() |
|
{ |
|
factory(User::class, 50) |
|
->create() |
|
->each(function ($u) { |
|
$u->profile()->save(factory(Profile::class)->make()); |
|
$u->tags()->saveMany(factory(Tag::class, 5)->make()); |
|
}); |
|
} |
|
}
|
|
|