Download the PHP package migralign/laravel-migralign without Composer

On this page you can find all versions of the php package migralign/laravel-migralign. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-migralign

MigrAlign

Align your database with your migrations.
Detect schema drift, add missing columns, auto-apply safe updates, and get guided confirmation for risky changes.

composer require migralign/laravel-migralign

Repository · Issues · Security


Table of contents

Overview

MigrAlign compares your Laravel migration-defined schema with the current MySQL/MariaDB schema and helps you synchronize differences safely.

It is useful when:

Features

Requirements

Installation

Install the package:

Laravel auto-discovers the service provider; no manual registration is required.

Publish config (optional):

This creates:

Quick start

  1. Update your migration files.
  2. Preview what would change:

  3. Apply sync:

How MigrAlign works

  1. Scan migration files from config('migralign.migrations_path')
  2. Build expected schema intent from migration up() logic
  3. Read live schema from MySQL information_schema
  4. Compute diff for tables and columns
  5. Classify risk for each change
  6. Apply safe changes automatically (if enabled)
  7. Prompt for risky changes (or skip/apply/abort)
  8. Print report

Risk model and behavior

MigrAlign classifies each change into one of:

Usually safe

Usually risky

Usually destructive

For risky/destructive changes, MigrAlign shows:

Command reference

Main command

Options

Typical command examples

Configuration

Default config file:

Config keys

Recommended workflows

Workflow A: Add a new column

When you add a column in migrations (Schema::create() or Schema::table()):

If the column is nullable or otherwise safe, it is created automatically.

Workflow B: Risky schema tightening

For changes like nullable(true) -> nullable(false) or length shrink:

  1. run --dry-run
  2. review pre-checks and remediation
  3. backfill/clean data if needed
  4. run sync and confirm prompts

Workflow C: Preview in CI or before deploy

Use dry-run locally or in pipelines to review planned changes:

--dry-run always exits successfully (status 0), even when drift is detected. For CI gates that must fail on drift, parse the command output or add your own wrapper check.

Examples

Example 1: New nullable column

Migration:

Result:

Example 2: Column removed from migration intent

If a column exists in DB but not in migration intent:

Example 3: Not-null tightening

Migration intent changes nullable column to not nullable:

Limitations

Troubleshooting

"supports MySQL/MariaDB only"

Your selected connection is not MySQL/MariaDB.
Use --connection= with a MySQL connection, or set migralign.connection.

No differences found but you expect changes

Risky change is blocked or skipped

FAQ

Should I edit old historical migrations?

Prefer adding new migrations for forward changes.
Editing old migrations can create large drift expectations across environments.

Is this a replacement for php artisan migrate?

No. migrate applies migration history; MigrAlign aligns current schema intent to live schema through diff + risk controls.

Can I use this in production?

Yes, but always run dry-run first and review destructive/risky operations.

Contributing

Contributions are welcome. See CONTRIBUTING.md for setup, test commands, and pull request guidelines.

Report security issues privately — see SECURITY.md.

License

MIT


All versions of laravel-migralign with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/console Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
laravel/prompts Version ^0.1.24|^0.3|^0.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package migralign/laravel-migralign contains the following files

Loading the files please wait ...