This method is called when the db:seed artisan command is executed. within the run method, you may insert data into your database however you wish. you may use the query builder to manually insert data or you may use eloquent model factories .. You need to put songstableseeder into file songstableseeder.php in the same directory where you have your databaseseeder.php file.. and you need to run in your console: composer dump-autoload to generate new class map and then run: php artisan db:seed i've just tested it.. Php artisan db:seed --class=productquantitytypeseeder [reflectionexception] class productquantitytypeseeder does not exist i executed several times "php artisan clear-compiled", "composer dump-autoload", "php artisan optimize" with no success..
Database seeding (1) / laravel each seed you add your table info. inside factories as like test seeder php artisan db:seed --class=userstableseeder stay with hello laravel.. Next, in the terminal run the command php artisan db:seed. this command starts execution and inserts the fake data in your specified database tables. we hope you understand how to do database seeding in laravel. please share your thoughts in the comment section below.. The following example will assign someuserevent to users table seed, and somegroupevent to groups table seed, to be executed before seeding. artisan iseed users,groups --prerun=someuserevent,somegroupevent the following example will only assign a somegroupevent to groups table seed, to be executed before seeding..