How ahtesham-clcbws/laravel-schema-sentinel works
Laravel Schema Sentinel is a Laravel package for schema integrity and database governance. Its main workflow compares a live database schema with an ideal schema produced by shadow-migration simulation or loaded from a snapshot, reports drift, and can generate a corrective migration. Separate capabilities cover index standardization, cross-environment data drift, legacy-schema reverse engineering, migration linting, environment checks, and a Livewire health dashboard. Several command and support implementations were not excerpted, so those capability links rely on README documentation; unsampled internal call paths are not asserted.
Main entry points: Commands Artisan commands · DriftCommand.php Drift audit · Sentinel.php Sentinel API · DTOs Schema and diff DTOs
Components 20
User interfaces
- Artisan commands
src/Console/Commands - Sentinel API
src/Sentinel.php - Sentinel facade
src/Facades/Sentinel.php - Health dashboard
src/Support/Livewire/DatabaseHealth.php - Dashboard view
resources/views/livewire/database-health.blade.php
Schema auditing
- Drift audit
src/Console/Commands/DriftCommand.php - Shadow migration simulation
src/Core/ShadowMigrationRunner.php - Schema snapshots
src/Core/SnapshotManager.php - Schema parser
src/Core/SchemaParser.php - Drift comparison
src/Core/DiffEngine.php - Fix migration generator
src/Core/MigrationGenerator.php
Schema model
- Schema and diff DTOs
src/DTOs
Governance tools
- Index standardization
src/Console/Commands/StandardizeIndexesCommand.php - Data drift audit
src/Console/Commands/DataDriftCommand.php - Migration linter
src/Console/Commands/LintCommand.php - Environment doctor
src/Console/Commands/DoctorCommand.php - Drift notifications
src/Support/NotificationManager.php
Reverse engineering
- Reverse command
src/Console/Commands/ReverseCommand.php - Schema reverse engineer
src/Core/ReverseEngineer.php
Other components
- Laravel operator
Connections 31
- Laravel operator → Artisan commands: runs commands
README.md - Laravel operator → Sentinel API: calls API
README.md - Laravel operator → Health dashboard: opens dashboard
README.md - Artisan commands → Drift audit: dispatches drift
src/SentinelServiceProvider.php - Drift audit → Shadow migration simulation: simulates migrations
src/Console/Commands/DriftCommand.php - Drift audit → Schema snapshots: loads snapshot
src/Console/Commands/DriftCommand.php - Drift audit → Schema parser: parses schemas
src/Console/Commands/DriftCommand.php - Drift audit → Drift comparison: compares schemas
src/Console/Commands/DriftCommand.php - Drift audit → Fix migration generator: generates fix
src/Console/Commands/DriftCommand.php - Drift audit → Drift notifications: sends alerts
src/Console/Commands/DriftCommand.php - Schema parser → Schema and diff DTOs: builds definitions
src/Core/SchemaParser.php - Drift comparison → Schema and diff DTOs: returns diff
src/Core/DiffEngine.php - Fix migration generator → Schema and diff DTOs: uses diff
src/Core/MigrationGenerator.php - Sentinel API → Shadow migration simulation: runs simulation
src/Sentinel.php - Sentinel API → Schema parser: parses schema
src/Sentinel.php - Sentinel API → Drift comparison: checks drift
src/Sentinel.php - Sentinel API → Schema reverse engineer: starts reversing
src/Sentinel.php - Sentinel facade → Sentinel API: resolves API
src/Facades/Sentinel.php - Health dashboard → Sentinel facade: checks drift
src/Support/Livewire/DatabaseHealth.php - Health dashboard → Dashboard view: renders view
src/Support/Livewire/DatabaseHealth.php - Artisan commands → Index standardization: dispatches indexes
src/SentinelServiceProvider.php - Artisan commands → Data drift audit: dispatches data audit
src/SentinelServiceProvider.php - Artisan commands → Migration linter: dispatches lint
src/SentinelServiceProvider.php - Artisan commands → Environment doctor: dispatches doctor
src/SentinelServiceProvider.php - Artisan commands → Reverse command: dispatches reverse
src/SentinelServiceProvider.php - Reverse command → Schema reverse engineer: requests generation
- Schema reverse engineer → Schema and diff DTOs: reads table definitions
src/Core/ReverseEngineer.php - Data drift audit → Laravel operator: reports comparison
README.md - Migration linter → Laravel operator: reports findings
README.md - Environment doctor → Laravel operator: reports health
README.md - Index standardization → Laravel operator: reports indexes
README.md