New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

lastdragon-ru/lara-asp-migrator

Improves standard Laravel migrations to add support for raw SQL files during migration and seeding. So you can easily use your favorite visual tool for database development with Laravel.
7,948
Install
composer require lastdragon-ru/lara-asp-migrator
Latest Version:11.2.1
PHP:^8.4|^8.5
Laravel:13
Older releases:8 – 12
License:MIT
Last Updated:Oct 9, 2026
Links: GitHub  ·  Packagist
Maintainer: LastDragon

(Laravel) Raw SQL Migrator/Seeder

This package improves standard Laravel migrations to add support for raw SQL files during migration and seeding. So you can easily use your favorite visual tool for database development like MySQL Workbench with Laravel 🥳

[!IMPORTANT]

The Migrator uses the same mechanism as Squashing Migrations so not all databases are supported, please see Laravel Documentation for more details.

[include:artisan]: https://github.com/LastDragon-ru/lara-asp-migrator/blob/HEAD/<lara-asp-documentator:requirements "{$directory}"> //: # (start: preprocess/78cfc4c7c7c55577) //: # (warning: Generated automatically. Do not edit.)

Requirements

Requirement Constraint Supported by
PHP ^8.5 HEAD ⋯ 11.0.0
^8.4 HEAD ⋯ 8.0.0
^8.3 10.3.0 ⋯ 5.0.0
^8.2 7.2.0 ⋯ 2.0.0
^8.1 6.4.2 ⋯ 2.0.0
^8.0 4.6.0 ⋯ 2.0.0
^8.0.0 1.1.2 ⋯ 0.12.0
>=8.0.0 0.11.0 ⋯ 0.4.0
>=7.4.0 0.3.0 ⋯ 0.1.0
Laravel ^13.10.0 HEAD ⋯ 11.1.0
^13.0.0 11.0.0
^12.0.1 10.3.0 ⋯ 9.0.0
^11.0.8 8.1.1 ⋯ 8.0.0
^11.0.0 7.2.0 ⋯ 6.2.0
^10.34.0 7.2.0 ⋯ 6.2.0
^10.0.0 6.1.0 ⋯ 2.1.0
^9.21.0 5.6.0 ⋯ 5.0.0-beta.1
^9.0.0 5.0.0-beta.0 ⋯ 0.12.0
^8.22.1 3.0.0 ⋯ 0.2.0
^8.0 0.1.0

Installation

composer require lastdragon-ru/lara-asp-migrator

Migrations

To create migration, just use the following command:

php artisan lara-asp-migrator:sql-migration MyMigration

It will create the following files in database/migrations:

2020_11_05_170802_my_migration.php
2020_11_05_170802_my_migration~down.sql
2020_11_05_170802_my_migration~up.sql

Usually, you just need to put your SQL into *~up.sql and *~down.sql 😇 Note that you still can use standard Laravel migrations. Also, migrations can be placed into subdirectories.

Seeders

The package uses a bit different approach compared with standard and provides a few different types of seeders:

  • Seeder - unlike standard Seeder it is safer and will not run seeder if it is already applied (so it is safe for production 🤩);
  • SqlSeeder - extends SmartSeeder and allow you to use SQL.

To create SQL Seeder you should use the command:

php artisan lara-asp-migrator:sql-seeder MySeeder

The command will create two files:

  • MySeeder.php - The class can be used to customize isSeeded() method, e.g. you can check if a model exists in the database.
  • MySeeder.sql - the file where the SQL seed stored.

Upgrading

Please follow Upgrade Guide.

Contributing

Please use the main repository to report issues, send pull requests, or ask questions.

Related Packages

crysalead/sql-dialect

SQL query builder.

13,238 6
usmanhalalit/pixie

A lightweight, expressive, framework agnostic query builder for PHP.

2,314,856 674
nguemoue/laravel-dbobject

Projet qui va permettre de faire la migration des procédure, fonctions, triggers...

3,309 1
danielme85/laravel-log-to-db

Custom Laravel Log channel handler that can store log events to SQL or MongoDB d...

1,097,876 133

Version History

Version Released PHP Laravel License
11.2.1 ^8.4|^8.5 ^13.10.0 MIT
11.2.0 ^8.4|^8.5 ^13.10.0 MIT
11.1.1 ^8.4|^8.5 ^13.10.0 MIT
11.1.0 ^8.4|^8.5 ^13.10.0 MIT
11.0.0 ^8.4|^8.5 ^13.0.0 MIT
Pre-releases (2)
Version Released PHP Laravel License
5.0.0-beta.1 ^8.1|^8.2 ^9.21.0|^10.0.0 MIT
5.0.0-beta.0 ^8.1|^8.2 ^9.0.0|^10.0.0 MIT