←Back

Creating a migration file

php artisan make:migration create_users_table 

Running one specific migration for the newly created table only: (right click file → copy relative path and add a slash)

php artisan migrate --path=/database/migrations/2024_05_09_111656_add_username_to_users_table.php

Running all migrations at once (only if theres no tables yet:)

php artisan migrate

Recreating all tables (without data!)

php artisan migrate:fresh 

Creating a seeder: I usually just duplicate an existing one and change names:) but:

**php artisan make:seeder UserSeeder**

!! When adding seeders, don’t forget to import them in databaseseeder.php

Running one specific seeder:

**php artisan db:seed --class=UserSeeder**

Running all seeders:

php artisan db:seed

Removing the table;

manually via phpmyadmin:)