lafnager-dev / laramap
Laravel CLI tool that visualizes database structure as a map.
Requires
- php: ^8.1
- illuminate/console: ^10.0|^11.0
- illuminate/support: ^10.0|^11.0
This package is not auto-updated.
Last update: 2026-06-07 06:36:47 UTC
README
Visualize your Laravel database like a map.
LaraMap is a Laravel package that helps you explore your database structure, models, and relationships directly from the terminal using Artisan commands. It is designed to make understanding Laravel projects fast and simple.
🚀 Installation
Install via Composer:
composer require lafnager-dev/laramap
⚙️ Usage
After installation, you can use the following commands:
Display all model relationships
php artisan laramap:relations
Example output:
Users
├── hasMany Orders
└── hasOne Profile
Orders
├── belongsTo User
└── hasMany OrderItems
Products
└── belongsTo Category
Inspect a specific table
php artisan laramap:show users
Example output:
Table: users
Columns:
- id
- name
- email
- password
- created_at
- updated_at
Relations:
- hasMany Orders
- hasOne Profile
🧠 How it works
LaraMap scans your Laravel project automatically by reading Eloquent models inside app/Models. It detects relationships such as hasOne, hasMany, belongsTo, and belongsToMany, then builds a relationship map and displays it in a clean CLI tree format.
📁 Requirements
- PHP 8.1 or higher
- Laravel 9 or newer
💡 Features
- ⚡ Fast Laravel model scanning
- 🌲 Clean CLI tree output
- 🔒 Read-only mode (no database changes)
- 🔧 Works in any Laravel project
📦 Package Structure
src/
├── Console/
│ ├── RelationsCommand.php
│ ├── ShowCommand.php
│
├── Scanner/
│ ├── ModelScanner.php
│ ├── RelationScanner.php
│ ├── TableScanner.php
│
└── LaramapServiceProvider.php
📌 Roadmap
Future improvements planned:
- Laravel relationship path finder (
laramap:path User Product) - Graph visualization mode
- Migration tracking support
- JSON export feature
- Interactive TUI mode
🤝 Contributing
Pull requests are welcome. Feel free to improve scanning logic or add new features.