Migrations

Altering Table Through Migrations Laravel

It is a very difficult job to change the column name or type once it is migrated and has contents. In order to modify the column, we need to create another migration where we state the modifications. Let us create a migration first by using the following command Php artisan make:migration change_post_description_to_nullable_in_tbl_posts —table=tbl_posts This will …

Altering Table Through Migrations Laravel Read More »

All about Migration Rollbacks

The examples are focused on how to roll back migrations on Laravel. This rolls back the last migrations Migration rollback according to steps. The below code will roll back the last two migrations. Change the steps to roll back accordingly. If you want to roll back as well as remigrate the last migrations To roll …

All about Migration Rollbacks Read More »