Skip to main content

🧩 Laravel Migration Linter

Migration Linter Latest Version on Packagist Total Downloads License

β€œSmart developers don’t debug production β€” they lint migrations.”


πŸ’‘ Overview​

Laravel Migration Linter is a lightweight developer tool that automatically scans your database migrations for risky schema changes before they hit production.

It acts as a static analyzer for your migrations β€” preventing downtime, data loss, or broken deploys by catching unsafe patterns early in your CI/CD pipeline.


πŸš€ Key Features​

  • 🧠 Safety-first linting β€” Detects dangerous operations like adding non-nullable columns without defaults or dropping columns.
  • ⚑ Performance awareness β€” Warns when missing indexes, column renames, or inefficient data types can impact query speed.
  • πŸ’Ύ Data integrity checks β€” Alerts when unique constraints, float columns, or type changes may corrupt data.
  • πŸ”’ Downtime prevention β€” Detects column renames and operations that cause table locks on production databases.
  • 🧩 Configurable rules β€” Enable, disable, or adjust severity (info, warning, error) per project.
  • 🧱 Baseline support β€” Ignore known legacy issues and focus only on new violations.
  • πŸ“Š Developer-friendly reports β€” Colorized console output, JSON export, and compact mode.
  • πŸ€– CI/CD ready β€” Integrates cleanly with GitHub Actions, GitLab, and other pipelines.
  • πŸ—οΈ SOLID Architecture (v2.0.0) β€” Extensible with dependency injection, custom formatters, and services.
  • πŸ’‘ Actionable Suggestions β€” Every warning includes fix recommendations and documentation links.

🧰 Why Use It​

Traditional Laravel migrations execute directly on production data β€” even small mistakes can cause downtime.
Laravel Migration Linter analyzes migrations before they run, letting you:

  • Prevent table locks and schema conflicts
  • Detect destructive operations in pull requests
  • Enforce safe migration practices across teams
  • Standardize schema evolution in CI/CD workflows

πŸ“Έ Example Reports​

Laravel Migration Linter HTML Report Screenshot from v2.1.0 β€” Interactive HTML report with charts, filtering, and search functionality
Laravel Migration Linter report Screenshot from v2.1.0 β€” showing lint warnings with flag check_all_tables => true in console output

🧭 Next Steps​


Β© 2025 Sufyan β€” Released under the MIT License.