TablePlus just released a plugin that lets you easily export a table to a Laravel Migration.
Even though I always build my migrations first on new projects, it’s pretty useful when you take over a new project whose migrations are not up to date or a project that was built with another framework.
In order to install it, just open TablePlus and go to the plugins panel (Cmd + L) and install “Dump Table”.
Once it’s installed, open a connection and right-click on a table. You should see a “Copy Script As” with a “Laravel Migration” option.
Once you click that option, the migration will be generated and copied to your clipboard.