database/seeds/PostsTableSeeder.php 1 location
|
@@ 19-27 (lines=9) @@
|
| 16 |
|
{ |
| 17 |
|
factory(Post::class, 20) |
| 18 |
|
->create() |
| 19 |
|
->each(function ($post) { |
| 20 |
|
$post->tags()->sync( |
| 21 |
|
factory(Tag::class, 4)->create()->pluck('id')->toArray() |
| 22 |
|
); |
| 23 |
|
|
| 24 |
|
$post->comments()->save(factory(Comment::class)->make()); |
| 25 |
|
$post->comments()->save(factory(Comment::class)->make()); |
| 26 |
|
$post->comments()->save(factory(Comment::class)->make()); |
| 27 |
|
}); |
| 28 |
|
} |
| 29 |
|
} |
| 30 |
|
|
src/Console/Commands/SetupCommand.php 1 location
|
@@ 68-76 (lines=9) @@
|
| 65 |
|
// Create data |
| 66 |
|
factory(Post::class, 20) |
| 67 |
|
->create() |
| 68 |
|
->each(function ($post) { |
| 69 |
|
$post->tags()->sync( |
| 70 |
|
factory(Tag::class, 4)->create()->pluck('id')->toArray() |
| 71 |
|
); |
| 72 |
|
|
| 73 |
|
$post->comments()->save(factory(Comment::class)->make()); |
| 74 |
|
$post->comments()->save(factory(Comment::class)->make()); |
| 75 |
|
$post->comments()->save(factory(Comment::class)->make()); |
| 76 |
|
}); |
| 77 |
|
} |
| 78 |
|
} |
| 79 |
|
|