clcbws/laravel-database-lifecycle-suite 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

clcbws/laravel-database-lifecycle-suite

最新稳定版本:1.0.0

Composer 安装命令:

composer require clcbws/laravel-database-lifecycle-suite

包简介

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

README 文档

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

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固