posts
table having a Post
model, we need to work with:php artisan make:factory PostFactory --model=Post
r[...]
'title'=>$faker->sentence(), 'content'=>$faker->paragraphs(rand(2, 10), true),
run()
function inside seeder as like below:public function run() { factory('App\Post', 10)->create(); }
php artisan tinker factory('App\Post', 10)->create()
Labels: Laravel, Web development