kitloong/laravel-migrations-generator
Generate Laravel migration files from an existing database schema, including columns, indexes, and foreign keys. Works with MariaDB/MySQL, PostgreSQL, SQL Server, and SQLite. Generate all tables or target/ignore specific tables via Artisan.
--default-fk-names
Use Laravel's default naming convention for foreign keys instead of the database foreign key names.
php artisan migrate:generate --default-fk-names
Schema with foreign key:
CREATE TABLE `comments` (
...
CONSTRAINT `user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
);
Will generate as:
Schema::table('comments', function (Blueprint $table) {
...
$table->foreign('user_id')->references('id')->on('users');
});
How can I help you explore Laravel packages today?