Laravel Seeders

Run Seeders

1. This command runs the Database\Seeders\DatabaseSeeder class, which may in turn invoke other seed classes:

php artisan db:seed

2. --class option to specify a specific seeder class to run individually:

php artisan db:seed --class=UserSeeder

3. Fresh Migrate and seed to delete all tables and recreate with data:

php artisan migrate:fresh --seed

Create Seeders

1. php artisan make:seeder seederclassname

Example: php artisan make:seeder UserSeeder

Comments

Popular posts from this blog