How to automatically generate Laravel Migration file from existing DB
Sep 5, 2020
PHP
migration
Laravel
artisan
oscarafdev / migrations-generator
- https://github.com/oscarafdev/migrations-generator
- If you search, you will find barryvdhandXethron. It seems that oscarafdev is recommended for all of them.
Introduction
- run composer
composer require "oscarafdev / migrations-generator" --dev
How to use
- Create a migration definition for all tables. .
APP_ENV = development php artisan migrate: generate
- Create by specifying a table. .
APP_ENV = development php artisan migrate: generate --tables = "user, password_resets"
- Create by excluding the specified table.
APP_ENV = development php artisan migrate: generate --ignore = "users, password_resets"