Run Single Seeder Class in Laravel

In Laravel if you are looking to run a single seeder class you can do so by running the following command


php artisan db:seed --class=PostTableSeeder

In the above command, class PostTableSeeder must exist inside Database/Seeders directory.

Running Single seeder class which are in a directory

If your seeder class is not in the default directory i.e. database/seeders then you can provide the complete path to the seeder command.


php artisan db:seed --class=Database\\Seeders\\Production\\PermissionSeeder
tgugnani: Web Stuff Enthusiast.