| @@ 204-214 (lines=11) @@ | ||
| 201 | // Seed the tags data |
|
| 202 | $tags = collect(); |
|
| 203 | $tag_counter = 1; |
|
| 204 | while ($tag_counter < 10) { |
|
| 205 | $name = ucfirst($faker->words(2, true)); |
|
| 206 | $tag = Tag::create([ |
|
| 207 | 'id' => Uuid::uuid4(), |
|
| 208 | 'slug' => Str::slug($name), |
|
| 209 | 'name' => $name, |
|
| 210 | ]); |
|
| 211 | ||
| 212 | $tags->push($tag); |
|
| 213 | $tag_counter++; |
|
| 214 | } |
|
| 215 | ||
| 216 | // Seed the topics data |
|
| 217 | $topics = collect(); |
|
| @@ 219-229 (lines=11) @@ | ||
| 216 | // Seed the topics data |
|
| 217 | $topics = collect(); |
|
| 218 | $topic_counter = 1; |
|
| 219 | while ($topic_counter < 10) { |
|
| 220 | $name = ucfirst($faker->words(2, true)); |
|
| 221 | $topic = Topic::create([ |
|
| 222 | 'id' => Uuid::uuid4(), |
|
| 223 | 'slug' => Str::slug($name), |
|
| 224 | 'name' => $name, |
|
| 225 | ]); |
|
| 226 | ||
| 227 | $topics->push($topic); |
|
| 228 | $topic_counter++; |
|
| 229 | } |
|
| 230 | ||
| 231 | // Associate tags and topics with the posts |
|
| 232 | $posts->each(function ($post) use ($tags, $topics) { |
|