Add tags to dummy bookmarks
This commit is contained in:
parent
8f531d9055
commit
abe5063c4a
2 changed files with 12 additions and 1 deletions
9
database/factories/TagFactory.php
Normal file
9
database/factories/TagFactory.php
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Faker\Generator as Faker;
|
||||||
|
|
||||||
|
$factory->define(App\Tag::class, function (Faker $faker) {
|
||||||
|
return [
|
||||||
|
'tag' => $faker->word,
|
||||||
|
];
|
||||||
|
});
|
|
@ -11,6 +11,8 @@ class BookmarksTableSeeder extends Seeder
|
||||||
*/
|
*/
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
factory(App\Bookmark::class, 10)->create();
|
factory(App\Bookmark::class, 10)->create()->each(function ($bookmark) {
|
||||||
|
$bookmark->tag()->save(factory(App\Tag::class)->make());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue