DEV Community

Cover image for Manage your Laravel migrations with 1 click!
Reza Amini
Reza Amini

Posted on

Manage your Laravel migrations with 1 click!

Have you ever want to migrate a single migration in Laravel?
You need to write a huge line of words in your command line to just migrate a migration.

Or have you ever tried to refresh or reset a migration?
In some cases the migration commands literally aren't understandable and you may wonder what is the fresh or refresh and should I use refresh or reset or other commands and what is the difference between them?

Imagine that you have over 10 migrations and you just want to refresh just one of them, to do this you need to execute this command:

php artisan migrate:refresh --path=database/migrations/2021_09_14_153949_create_products_table.php
Enter fullscreen mode Exit fullscreen mode

Hmmm, to me and lots of you it's not enjoyable and also it does take time to write in command line and if we type the wrong name we may lose our data in database.

So what should we do?

Here Migrator comes!

Migrator is a GUI migration manager for Laravel.

With Migrator you can manage your migration as easy as possible in a beautiful user interface.

Migrator features:

  • Create new migration
  • Migrate all migrations
  • Fresh migrations
  • Drop a single migration
  • Migrate a single migration
  • Delete and drop a migration
  • See the status of migrations
  • Refresh a migration (Drop then up)
  • Show the migration data in a better way!

Alt Text

So we have talked about the features, let's install Migrator in a minute.

Installing Migrator is super duper easy, you just need to run a single composer command:

composer require rezaamini-ir/migrator
Enter fullscreen mode Exit fullscreen mode

Congrats! Migrator was installed successfully, now you will be to access the /migrator path in your project and if you want to change the authentication method or Migrator route you can publish config file with this command:

php artisan vendor:publish --tag=migrator-config
Enter fullscreen mode Exit fullscreen mode

Then a new file will be created in your config directory called: migrator.php and you can change the middleware which authenticates the user and also the route of the package is editable.

To read more about the Migrator package you can check out the documentation:

Don't forget to contribute to the project and Star it ⭐️ :)).

Top comments (0)