PHPackages                             clcbws/laravel-database-lifecycle-suite - 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. clcbws/laravel-database-lifecycle-suite

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

clcbws/laravel-database-lifecycle-suite
=======================================

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

1.0.0(2mo ago)310↓88.9%MITPHPPHP ^8.2CI failing

Since May 6Pushed 2mo agoCompare

[ Source](https://github.com/ahtesham-clcbws/laravel-database-lifecycle-suite)[ Packagist](https://packagist.org/packages/clcbws/laravel-database-lifecycle-suite)[ RSS](/packages/clcbws-laravel-database-lifecycle-suite/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

Laravel Database Lifecycle Suite
================================

[](#laravel-database-lifecycle-suite)

[![Latest Version on GitHub](https://camo.githubusercontent.com/7d5c8a4475389fec0037635f41e8de1dcd72ecbfb7a1e4aca3d05298f67c980c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f616874657368616d2d636c636277732f6c61726176656c2d64617461626173652d6c6966656379636c652d73756974653f696e636c7564655f70726572656c6561736573267374796c653d666c61742d737175617265)](https://github.com/ahtesham-clcbws/laravel-database-lifecycle-suite/releases)[![Total Downloads](https://camo.githubusercontent.com/c0f5204312a19854fb7cf39ab1fbff64cad895f42fb4d8ac5c661f2acea71256/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c636277732f6c61726176656c2d64617461626173652d6c6966656379636c652d73756974652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/clcbws/laravel-database-lifecycle-suite)[![License](https://camo.githubusercontent.com/1e494add53473d76472504f049b297912ff28b5c8097370478e6496237a7bb0c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f616874657368616d2d636c636277732f6c61726176656c2d64617461626173652d6c6966656379636c652d73756974653f7374796c653d666c61742d737175617265)](https://github.com/ahtesham-clcbws/laravel-database-lifecycle-suite/blob/main/LICENSE.md)

**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
----------

[](#-showcase)

### Database Lifecycle Scorecard

[](#database-lifecycle-scorecard)

Get a comprehensive health check of your database in one command. [![Lifecycle Status](screenshots/lifecycle-status.jpg)](screenshots/lifecycle-status.jpg)

### Connection Latency Monitoring

[](#connection-latency-monitoring)

Verify reachability and measure performance across all your database nodes. [![Connection Check](screenshots/connection-check.jpg)](screenshots/connection-check.jpg)

### Index Standardizer

[](#index-standardizer)

Keep your index naming consistent across your entire application. [![Index Standardizer](screenshots/standardize-indexes.jpg)](screenshots/standardize-indexes.jpg)

---

✨ Key Features
--------------

[](#-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 &amp; Growth Report**: Monitor disk usage and row counts across all tables.
- 🔬 **Query Explainer**: Get human-readable performance insights for any SQL query.
- 🧪 **Cast &amp; Type Audit**: Detect discrepancies between Eloquent Model `$casts` and physical DB types.

---

📦 Installation
--------------

[](#-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
-------

[](#-usage)

### 1. Database Health &amp; Auditing

[](#1-database-health--auditing)

#### Lifecycle Scorecard

[](#lifecycle-scorecard)

To get a full overview of your database health:

```
php artisan db:lifecycle-status
```

#### Missing Index Audit

[](#missing-index-audit)

To identify unindexed Foreign Keys and potential performance bottlenecks:

```
php artisan db:index-audit
```

#### PII Scanning

[](#pii-scanning)

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

```
php artisan db:pii-scan
```

### 2. Optimization &amp; Standardization

[](#2-optimization--standardization)

#### Standardize Index Names

[](#standardize-index-names)

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

```
php artisan db:standardize-indexes
```

#### Find Redundant Indexes

[](#find-redundant-indexes)

To find overlapping indexes that should be removed:

```
php artisan db:index-redundancy
```

### 3. Reverse Engineering &amp; Visualization

[](#3-reverse-engineering--visualization)

#### Legacy Bridge

[](#legacy-bridge)

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

```
php artisan db:legacy-bridge
```

#### Generate ERD

[](#generate-erd)

To generate a Mermaid.js diagram of your database:

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

### 4. Snapshots &amp; Data Integrity

[](#4-snapshots--data-integrity)

#### Schema Snapshot

[](#schema-snapshot)

To save the current schema state:

```
php artisan db:snapshot baseline
```

#### Data Drift Check

[](#data-drift-check)

To compare data records against a source connection:

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

---

🏗️ Architecture
---------------

[](#️-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
--------------------

[](#️-versioning-system)

We follow [Semantic Versioning (SemVer)](https://semver.org/):

- **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
---------

[](#-license)

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

---

🤝 Credits
---------

[](#-credits)

- **Author**: [Ahtesham](mailto:ahtesham@clcbws.com)
- **Company**: [Broadway Web Service](https://www.clcbws.com)

---

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance85

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

80d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17913874?v=4)[Ahtesham Abdul Aziz](/maintainers/ahtesham-clcbws)[@ahtesham-clcbws](https://github.com/ahtesham-clcbws)

---

Top Contributors

[![ahtesham-clcbws](https://avatars.githubusercontent.com/u/17913874?v=4)](https://github.com/ahtesham-clcbws "ahtesham-clcbws (6 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/clcbws-laravel-database-lifecycle-suite/health.svg)

```
[![Health](https://phpackages.com/badges/clcbws-laravel-database-lifecycle-suite/health.svg)](https://phpackages.com/packages/clcbws-laravel-database-lifecycle-suite)
```

###  Alternatives

[spatie/laravel-medialibrary

Associate files with Eloquent models

6.2k43.2M656](/packages/spatie-laravel-medialibrary)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M246](/packages/laravel-ai)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k96.5k1](/packages/mike-bronner-laravel-model-caching)[itpathsolutions/dbstan

Database Standardization and Analysis Tool for Laravel

463.0k](/packages/itpathsolutions-dbstan)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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