Laravel schema diff — free to use

Laravel Schema Diff.
Compare migrations.
Zero setup.

Paste two php artisan schema:dump outputs or raw CREATE TABLE dumps from your Laravel app. Spot every table, column, index, and constraint change instantly. Get ready-to-run ALTER TABLE scripts for MySQL or PostgreSQL — all in your browser.

No account required. No data leaves your device.

Built for Laravel & Eloquent workflows

SchemaLens understands Laravel-specific patterns that generic diff tools miss.

🔶

Migration Review

Compare the schema before and after running php artisan migrate. Catch unexpected column changes, missing indexes, or constraint drift before deploying to production.

🗑️

Soft Delete Detection

Warns when deleted_at is missing from a table that should have it. Catches schema drift that breaks Eloquent's withTrashed() and onlyTrashed() queries.

⏱️

Timestamps & Enums

Detects changes to created_at / updated_at columns and enum-backed columns. Validates that enum values match your Eloquent $casts definitions.

🔗

Foreign Key Constraints

Validates constrained() and onDelete('cascade') migrations. Detects missing or changed foreign keys that could break Eloquent relationships.

🔄

Pivot Table Diff

Compares many-to-many pivot tables for extra columns, composite keys, and timestamp changes. Critical for apps with complex belongsToMany relationships.

🔒

Privacy First

Your schema never leaves the browser. Compare production Laravel schemas safely without uploading sensitive table structures to a third-party server.

How it works with Laravel

1

Dump your schemas

Run php artisan schema:dump --database=mysql on both environments (local vs staging, or staging vs production).

2

Paste into SchemaLens

Copy the SQL into the two editor panes. Dialect auto-detects MySQL or PostgreSQL based on your Laravel DB_CONNECTION.

3

Review the diff

See added tables, dropped columns, type changes, and constraint modifications highlighted in color. Check for breaking changes before deploying.

4

Copy the migration

Export ALTER TABLE scripts, save as Markdown for PR descriptions, or generate rollback SQL. Run in staging, then production.

Laravel migration examples

SchemaLens generates production-ready ALTER TABLE scripts for every change it detects.

Add a new column

ALTER TABLE `users`
  ADD COLUMN `two_factor_secret` VARCHAR(255) NULL;

Change enum values

ALTER TABLE `orders`
  MODIFY COLUMN `status` ENUM('pending','paid','shipped','refunded');

Add a foreign key

ALTER TABLE `comments`
  ADD CONSTRAINT `comments_post_id_foreign`
  FOREIGN KEY (`post_id`) REFERENCES `posts`(`id`)
  ON DELETE CASCADE;

Add soft delete timestamp

ALTER TABLE `products`
  ADD COLUMN `deleted_at` TIMESTAMP NULL;

Related guides

Ready to diff your Laravel schemas?

A privacy-first schema diff tool. No account required.

Start Comparing Free

Free forever — unlimited tables. Pro power features — $39 once.