How febryan1453/laravel-erd works
Laravel ERD Generator scans Laravel Eloquent models, derives relationship links and table-column nodes, then serves an interactive diagram or writes static HTML. The web route delegates to a controller; the CLI command independently invokes the same generator. The template renders and filters the returned data with GoJS. The core implementation is excerpted; relationships among Laravel package-tool registrations and runtime wiring are included only where the shown source or README supports them.
Main entry points: LaravelERDCommand.php Generate command · LaravelERD.php ERD data · LaravelERDController.php Web controller · web.php Web route
Components 15
Laravel entry points
- Package provider
src/LaravelERDServiceProvider.php - Package config
config/laravel-erd.php - Web route
routes/web.php - Web controller
src/Controllers/LaravelERDController.php - Generate command
src/Commands/LaravelERDCommand.php
ERD generation
- Model discovery
src/LaravelERD.php - Relation inspection
src/LaravelERD.php - Schema extraction
src/LaravelERD.php - ERD data
src/LaravelERD.php
Diagram output
- Diagram template
resources/views/index.blade.php - GoJS renderer
Other components
- Developer
- Eloquent models
- Laravel database
- HTML files
Connections 20
- Developer → Generate command: runs
README.md - Developer → Web route: opens
README.md - Package provider → Generate command: registers
src/LaravelERDServiceProvider.php - Package provider → Web route: loads
src/LaravelERDServiceProvider.php - Web route → Web controller: routes to
routes/web.php - Web route → Package config: reads
routes/web.php - Web controller → Package config: reads
src/Controllers/LaravelERDController.php - Web controller → ERD data: requests
src/Controllers/LaravelERDController.php - Generate command → Package config: reads
src/Commands/LaravelERDCommand.php - Generate command → ERD data: requests
src/Commands/LaravelERDCommand.php - Model discovery → Eloquent models: scans
src/LaravelERD.php - Relation inspection → Eloquent models: reflects
src/LaravelERD.php - Schema extraction → Laravel database: reads schema
src/LaravelERD.php - ERD data → Model discovery: finds models
src/LaravelERD.php - ERD data → Relation inspection: collects links
src/LaravelERD.php - ERD data → Schema extraction: collects nodes
src/LaravelERD.php - Web controller → Diagram template: renders
src/Controllers/LaravelERDController.php - Generate command → Diagram template: renders
src/Commands/LaravelERDCommand.php - Generate command → HTML files: writes HTML
src/Commands/LaravelERDCommand.php - Diagram template → GoJS renderer: renders diagram
resources/views/index.blade.php