clcbws/laravel-database-lifecycle-suite

A complete database lifecycle suite for Laravel including index standardization, data drift detection, and reverse-engineering.

Maintainers

Package info

github.com/ahtesham-clcbws/laravel-database-lifecycle-suite

pkg:composer/clcbws/laravel-database-lifecycle-suite

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-05-06 04:41 UTC

This package is auto-updated.

Last update: 2026-05-06 04:50:25 UTC


README

Latest Version on GitHub Total Downloads License

Laravel Database Lifecycle Suite is a premium toolkit designed for database reverse-engineering, optimization, and visualization. It provides a comprehensive 360-degree view of your database health, from structural integrity to performance bottlenecks. Fully optimized for Laravel 13.x, with legacy support for 12.x and 11.x.

๐Ÿ“ธ Showcase

Database Lifecycle Scorecard

Get a comprehensive health check of your database in one command. Lifecycle Status

Connection Latency Monitoring

Verify reachability and measure performance across all your database nodes. Connection Check

Index Standardizer

Keep your index naming consistent across your entire application. Index Standardizer

โœจ Key Features

  • ๐ŸŒ‰ Legacy Bridge: Reverse-engineer an entire database into a clean Laravel project (Migrations, Models, Factories, Seeders).
  • ๐Ÿ“Š Lifecycle Scorecard: A quantifiable database health check covering performance, integrity, and connectivity.
  • ๐Ÿ“ Index Standardizer: Automatically rename indexes to follow Laravel conventions.
  • ๐Ÿ›ก๏ธ Index Health Audit: Detects unindexed Foreign Keys and Potential Foreign Keys (missing indexes on _id columns).
  • ๐Ÿ” Redundant Index Detector: Identifies overlapping indexes that slow down write operations.
  • ๐Ÿ”„ Data Drift Deep Dive: Compare data row-by-row across connections with interactive sync.
  • ๐Ÿ“ธ Schema Snapshotting: Save schema states to JSON for offline comparison or time-travel restoration.
  • ๐ŸŽจ ERD Visualizer: Generate Mermaid.js Entity Relationship Diagrams directly from your schema.
  • ๐Ÿ”’ PII Scanner: Identify potential security risks by scanning for sensitive data patterns.
  • ๐Ÿ“ˆ Size & Growth Report: Monitor disk usage and row counts across all tables.
  • ๐Ÿ”ฌ Query Explainer: Get human-readable performance insights for any SQL query.
  • ๐Ÿงช Cast & Type Audit: Detect discrepancies between Eloquent Model $casts and physical DB types.

๐Ÿ“ฆ Installation

You can install the package via composer:

composer require clcbws/laravel-database-lifecycle-suite

Tip

To enable Structural Drift Detection in the db:lifecycle-status report, we highly recommend also installing: composer require clcbws/laravel-schema-sentinel

Publish the configuration file:

php artisan vendor:publish --provider="Clcbws\DatabaseLifecycleSuite\DatabaseLifecycleSuiteServiceProvider" --tag="config"

๐Ÿš€ Usage

1. Database Health & Auditing

Lifecycle Scorecard

To get a full overview of your database health:

php artisan db:lifecycle-status

Missing Index Audit

To identify unindexed Foreign Keys and potential performance bottlenecks:

php artisan db:index-audit

PII Scanning

To identify sensitive data columns (Email, Phone, etc.):

php artisan db:pii-scan

2. Optimization & Standardization

Standardize Index Names

To fix non-standard index names (includes --dry-run support):

php artisan db:standardize-indexes

Find Redundant Indexes

To find overlapping indexes that should be removed:

php artisan db:index-redundancy

3. Reverse Engineering & Visualization

Legacy Bridge

To reverse-engineer your database into a new Laravel project:

php artisan db:legacy-bridge

Generate ERD

To generate a Mermaid.js diagram of your database:

php artisan db:erd --output=schema.mmd

4. Snapshots & Data Integrity

Schema Snapshot

To save the current schema state:

php artisan db:snapshot baseline

Data Drift Check

To compare data records against a source connection:

php artisan db:data-drift --source=production --table=users

๐Ÿ—๏ธ Architecture

The suite is built with a modular "Auditor-Engine" architecture:

  1. Auditors: Dedicated classes that analyze specific database traits (PII, Indexes, Casts).
  2. Engines: Reusable core components for Snapshotting, Drift Detection, and Code Generation.
  3. Traits: Standardized shared logic like FiltersTables for multi-database isolation.

โš™๏ธ Versioning System

We follow Semantic Versioning (SemVer):

  • MAJOR (1.x.x): Breaking changes or significant architectural shifts.
  • MINOR (x.1.x): New features added in a backwards-compatible manner.
  • PATCH (x.x.1): Backwards-compatible bug fixes and small improvements.

๐Ÿ“„ License

The MIT License (MIT). Please see License File for more information.

๐Ÿค Credits