Download the PHP package clcbws/laravel-schema-sentinel without Composer
On this page you can find all versions of the php package clcbws/laravel-schema-sentinel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-schema-sentinel
Laravel Schema Sentinel
Read this in: English | PortuguΓͺs (Brasil)
[!NOTE] This English document is the canonical source of truth for Laravel Schema Sentinel. All translations are maintained in sync with this document.
Laravel Schema Sentinel is a premium database schema integrity and governance suite. It detects and resolves "Schema Drift" (discrepancies between migration blueprints and the actual database state) and provides automated tools to standardize index configurations, audit content syncs, lint migration files, and reverse-engineer legacy tables.
π Table of Contents
- Getting Started
- Introduction
- Key Features
- Installation
- Configuration
- Artisan Commands
- Auditing Schema Drift (
schema:drift) - Index Standardization (
schema:standardize-indexes) - Data Drift Deep Dive (
schema:data-drift) - Legacy Database Reversing (
schema:reverse) - Migration File Linter (
schema:sentinel-lint) - Environment Doctor (
schema:sentinel-doctor)
- Auditing Schema Drift (
- Programmatic API
- Drift Auditing
- Parsing Schema DTOs
- Index Standardization
- Data Drift Audits
- Programmatic Reversing
- Livewire Component & Blade UI
- Legacy Compatibility
- Changelogs
π Getting Started
Introduction
In modern application deployment, database schemas can easily drift from migration files due to hotfixes, legacy imports, direct database edits, or faulty rollbacks. Schema Sentinel provides a total isolation simulation engine that runs migrations on a shadow database to establish the "ideal" schema, matches it against your live connection, and generates fixes automatically.
Key Features
- π‘οΈ Deep Drift Detection: Audits Tables, Columns, Types, Nullability, Defaults, Indexes, and Foreign Keys.
- β‘ Programmatic Facade: Full API coverage for building custom monitoring dashboards.
- π Index Naming Standardizer: Automatically validates index names against Laravel conventions.
- π’ Slow Migration Audit: Pinpoints slow migration files during simulation.
- π Rollback Audit: Simulates rollbacks to ensure your schema can be cleanly rolled back.
- π Cross-Environment Sync: Compare your schema against other environments (Staging/Production).
- π€ CI/CD Ready: Returns standard shell exit codes for pipeline validation.
Installation
Install the package via Composer:
The service provider and facade will be registered automatically.
Configuration
Publish the configuration file:
This creates config/schema-sentinel.php which allows you to define:
ignore_tables: Array of table names to exclude from analysis (e.g.,migrations,telescope_entries).migration_paths: Paths to your migration files (useful for modular applications).shadow_connection: Temporary database settings (defaults to isolated SQLite in-memory).skip_migrations: List of migration files to skip during shadow simulation.notifications: Slack and Discord webhooks for drift alerts.
π» Artisan Commands
Auditing Schema Drift (schema:drift)
Run the core schema audit to inspect the health of your database:
Options:
--fix: Generate a new Laravel migration to align your database.--interactive: Confirm column changes step-by-step.--sql: Preview generated SQL code in dry-run mode.--strict: Report extra tables and columns in the live DB that are not defined in migrations.--rollback: Run migrations and roll them back on the shadow DB to verify reversibility.--snapshot[=latest]: Use a frozen JSON snapshot for audit speed.--tag=name: Limit audits to migrations marked with@sentinel-tag name.
Index Standardization (schema:standardize-indexes)
Inspect your database for non-standard index names and redundant indexes (e.g., column indexes already covered by composite index prefixes):
Options:
--fix: Generate a migration file to automatically rename deviating indexes and drop duplicate ones.
Data Drift Deep Dive (schema:data-drift)
Audit static lookup or seed tables to verify content consistency between environments:
Outputs a terminal-based diff table indicating missing, extra, or mismatched rows.
Legacy Database Reversing (schema:reverse)
Reverse-engineer a legacy database into a clean Laravel setup:
Options:
--models: Generate Eloquent Model classes with typed relationships (belongsTo,hasMany) and docblocks.--migrations: Generate Blueprint migration files.--seeders: Generate seeders filled with sample database records.--enums: Generate native PHP 8.4 Backed Enums linked to model casts.
Migration File Linter (schema:sentinel-lint)
Audit your codebase migrations for anti-patterns that can cause drift:
Scans for:
- Raw
DB::statementcalls. - Hardcoded platform-specific string default dates (like
'CURRENT_TIMESTAMP'). - Unsafe
Schema::dropcalls lackingIfExists.
Environment Doctor (schema:sentinel-doctor)
Run the health advisor to verify your environment configurations (PHP version, PDO drivers, shadow connection configs):
Help Guides & Spelling Matcher (schema:help)
Get detailed command help, configuration tips, and options. If you make a typo, the built-in Levenshtein suggestion engine will automatically suggest the correct command:
π Programmatic API
You can integrate Sentinel programmatically inside controllers, dashboards, or deployment hooks using the Sentinel facade.
Drift Auditing
Parsing Schema DTOs
Extract structured metadata representing your database layout:
Index Standardization
Run the index analyzer programmatically:
Data Drift Audits
Audit data consistency against a target connection:
Programmatic Reversing
Trigger the reverse engineering generator from code:
Livewire Component & Blade UI
Display database integrity metrics inside your admin templates:
Or check programmatically in Blade layouts:
β οΈ Legacy Compatibility
While the latest version of this package requires Laravel 13.x and PHP 8.4+, developers running Laravel 11.x or 12.x (with PHP 8.2 or 8.3) can use the stable v1.6.0 release:
| Laravel Version | Supported PHP Versions | Package Version |
|---|---|---|
| Laravel 11.x | PHP 8.2 - 8.4 |
~1.6.0 |
| Laravel 12.x | PHP 8.2 - 8.5 |
~1.6.0 |
π‘οΈ Compatibility & Test Status
- Laravel Compatibility: Laravel 13.x ONLY (Zero backward-compatibility shims for Laravel 10/11/12).
- Minimum PHP Version: PHP 8.4+ (Fully tested on PHP 8.4 and PHP 8.5).
- Verified Database Engines:
- SQLite: 3.49+ (In-memory and file-based).
- PostgreSQL: 16+ / 18+ (Tested with dedicated shadow connection).
- MySQL / MariaDB: 8.0+ / 13.0+ (Tested in multi-service CI container matrix).
- Genuine Test Reports & Evidence:
- Test Matrix
- Real Application Test Results
- Known Limitations & Dialect Behavior
- Performance Benchmarks
π Changelogs
Release: v2.1.0
- Shadow Migration Isolation: Hardened
ShadowMigrationRunnerto eliminate global connection mutation; added strict target identity checks preventing accidental runs on live connections. - Pre-Migration Guard: Replaced runtime
exit(1)withMigrationBlockedExceptionand implemented deterministic internal bypass to prevent re-entrancy and test crashes. - DiffEngine & Type Normalization: Resolved false positives across database engines for types (
varchar,bigint,boolean), compound indexes, and foreign key action comparisons. - Migration Generator: Fixed missing index and foreign key definitions in generated table creations, added
--realpathsupport for Laravel 13, and added idempotency guards. - Data Safety: Removed live database record dumping in generated seeders, removed dummy enum fabrication, and purged external telemetry network exfiltration.
- Laravel 13 Ecosystem Validation: Validated in fresh real Laravel 13 application and configured automated GitHub Actions matrix.
For past version releases, see changelogs/v1.0.0.md.
π€ Credits
- Author: Ahtesham
- Company: Broadway Web Service
- License: MIT License
All versions of laravel-schema-sentinel with dependencies
illuminate/support Version ^13.0
illuminate/database Version ^13.0
illuminate/console Version ^13.0