PHPackages                             farzai/laravel-schema - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. farzai/laravel-schema

ActiveLibrary[Database &amp; ORM](/categories/database)

farzai/laravel-schema
=====================

Visualize and compare database schemas between Laravel migrations and your database

v0.1.0(4mo ago)00[2 PRs](https://github.com/parsilver/laravel-schema/pulls)MITPHPPHP ^8.4CI passing

Since Jan 12Pushed 1mo agoCompare

[ Source](https://github.com/parsilver/laravel-schema)[ Packagist](https://packagist.org/packages/farzai/laravel-schema)[ Docs](https://github.com/parsilver/laravel-schema)[ GitHub Sponsors](https://github.com/parsilver)[ RSS](/packages/farzai-laravel-schema/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (14)Versions (4)Used By (0)

Laravel Schema
==============

[](#laravel-schema)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7ae51144bfc25d028959689a3e7c04a3eb7c44bfe5d7d7d95703ec307532f59d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6661727a61692f6c61726176656c2d736368656d612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/farzai/laravel-schema)[![GitHub Tests Action Status](https://camo.githubusercontent.com/90d2a271e21fe8d571180d8783ddcf9eae3997f06bafd65b330e09b526dbfad5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70617273696c7665722f6c61726176656c2d736368656d612f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/parsilver/laravel-schema/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/dc131bcc9ea83b9d9b80fca49e20f935a1fed904c3d4d9002089ff8a4796c183/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70617273696c7665722f6c61726176656c2d736368656d612f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/parsilver/laravel-schema/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/e0fc28800d0e9802ff84fe1f005bf4a166eb3d79dddf147620f8127e47f6d046/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6661727a61692f6c61726176656c2d736368656d612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/farzai/laravel-schema)

A Laravel package for visualizing and comparing database schemas. View your database structure through an interactive ER diagram dashboard and identify differences between your migration files and actual database state.

Similar to Laravel Horizon and Telescope, it provides a beautiful web interface for schema inspection. **This package is view-only** — it detects and visualizes differences but does not generate or apply migrations.

[![Laravel Schema Dashboard](art/screenshot.png)](art/screenshot.png)

Features
--------

[](#features)

- **Interactive ER Diagram** — Visualize your database schema with React Flow
- **Schema Comparison** — Compare migrations vs actual database state
- **Multi-Database Support** — MySQL, PostgreSQL, SQLite, and SQL Server
- **Diff Detection** — See added, removed, and modified tables/columns at a glance
- **REST API** — Programmatic access to schema data
- **Gate-based Authorization** — Secure access similar to Horizon/Telescope
- **Dark Mode** — Beautiful dark theme out of the box

Requirements
------------

[](#requirements)

- PHP 8.4+
- Laravel 11.x or 12.x

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require farzai/laravel-schema
```

Publish the configuration file:

```
php artisan vendor:publish --tag=laravel-schema-config
```

Publish the frontend assets:

```
php artisan vendor:publish --tag=laravel-schema-assets
```

Configuration
-------------

[](#configuration)

The configuration file will be published to `config/schema.php`:

```
return [
    // Subdomain for Laravel Schema (optional)
    'domain' => env('SCHEMA_DOMAIN'),

    // URI path where the dashboard is accessible
    'path' => env('SCHEMA_PATH', 'schema'),

    // Route middleware
    'middleware' => ['web'],

    // Authorization settings
    'authorization' => [
        'enabled' => true,
        'gate' => 'viewLaravelSchema',
    ],

    // Path to migrations directory
    'migrations_path' => 'database/migrations',

    // Database connection (null = default)
    'connection' => null,

    // Tables to ignore during comparison
    'ignored_tables' => [
        'migrations',
        'password_reset_tokens',
        'sessions',
        'cache',
        'cache_locks',
        'jobs',
        'job_batches',
        'failed_jobs',
    ],
];
```

Authorization
-------------

[](#authorization)

By default, Laravel Schema is only accessible in the `local` environment. To configure access in other environments, define authorization logic in your `AppServiceProvider`:

```
use Farzai\LaravelSchema\SchemaInspector;

public function boot(): void
{
    SchemaInspector::auth(function ($request) {
        return app()->environment('local') ||
               in_array($request->user()?->email, [
                   'admin@example.com',
               ]);
    });
}
```

Dashboard
---------

[](#dashboard)

Once installed, access the dashboard at:

```
http://your-app.test/schema

```

The dashboard provides:

- **ER Diagram** — Interactive visualization of your database tables and relationships
- **Schema Differences** — Visual indicators for added, removed, and modified schema elements
- **Table Details** — Column types, indexes, and foreign key information
- **Legend** — Color-coded guide for understanding diff status

API Endpoints
-------------

[](#api-endpoints)

Laravel Schema exposes a REST API for programmatic access:

MethodEndpointDescriptionGET`/schema`Dashboard (React SPA)GET`/schema/api/tables`List all database tablesGET`/schema/api/tables/{table}`Get specific table detailsGET`/schema/api/diff`Full schema comparisonGET`/schema/api/diff/{table}`Table-specific diffGET`/schema/api/migrations`List migration filesGET`/schema/api/status`Schema sync status summaryPOST`/schema/api/refresh`Force schema refreshTesting
-------

[](#testing)

```
composer test
```

Run tests with coverage:

```
composer test-coverage
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [parsilver](https://github.com/parsilver)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance84

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

126d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4928451?v=4)[parsilver](/maintainers/parsilver)[@parsilver](https://github.com/parsilver)

---

Top Contributors

[![parsilver](https://avatars.githubusercontent.com/u/4928451?v=4)](https://github.com/parsilver "parsilver (12 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

difflaravelschemadatabasemigrationsvisualizationfarzai

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/farzai-laravel-schema/health.svg)

```
[![Health](https://phpackages.com/badges/farzai-laravel-schema/health.svg)](https://phpackages.com/packages/farzai-laravel-schema)
```

###  Alternatives

[laravel-doctrine/migrations

Doctrine Migrations for Laravel

782.8M16](/packages/laravel-doctrine-migrations)[orptech/laravel-migration-partition

Laravel extensions that extends Illuminate to enable partitioned table creation within Laravel migrations.

3426.7k](/packages/orptech-laravel-migration-partition)[nunomaduro/laravel-optimize-database

Publishes migrations that make your database production ready.

26123.0k](/packages/nunomaduro-laravel-optimize-database)[dragon-code/laravel-data-dumper

Adding data from certain tables when executing the `php artisan schema:dump` console command

3418.6k](/packages/dragon-code-laravel-data-dumper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
