Laravel Migrations

1. Run all migration files:

php artisan migrate

2. Re run specific migration file:

php artisan migrate:refresh --path=database/migrations/2021_07_05_120856_create_users_table.php

3. Drop All Tables & Migrate (drop all tables and recreate):

php artisan migrate:fresh

php artisan migrate:fresh --seed

4. Create migration file:

php artisan make:migration create_tablename_table (replace tablename with table name and keep other keywords as it is

php artisan make:migration create_roles_table (this command will create migration file for roles table

5. Delete migration file

1. First delete migration file from migration folder app/database/migrations/my_migration_file_name.php

2. Reset the composer autoload files: composer dump-autoload

Comments

Popular posts from this blog

Git Commands