Laravel Basic
Laravel Form
Laravel Database
Laravel Advance
Update .env file variable for Database connection:
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=my_app DB_USERNAME=root DB_PASSWORD=
Just like routes have multiple types, Migrations also have different operations.
Command |
Description |
---|---|
php artisan make:migration create_users_table |
Create a new migration file |
php artisan migrate |
Run all pending migrations |
php artisan migrate:rollback |
Rollback the last batch of migrations |
php artisan migrate:reset |
Rollback all migrations |
php artisan migrate:refresh |
Rollback & re-run all migrations |
php artisan migrate:fresh |
Drop all tables & re-run migrations |
php artisan migrate:status |
Show migration status (which are run / pending) |