araminco/laravel-ai-mapper
Composer 安装命令:
composer require araminco/laravel-ai-mapper
包简介
A Laravel package to generate an AI-friendly map of the project structure, database, and dependencies.
README 文档
README
A Laravel Artisan command that scans your project and generates a comprehensive, AI-friendly JSON map. This map allows AI models to understand your project's architecture, overcoming context limits and enabling more intelligent, context-aware assistance.
✨ Features
This package extracts and maps the following information into a single JSON file:
- Project Overview: App name, Laravel, and PHP versions.
- Environment Details: Key configuration values like environment, debug mode, and drivers for cache, queue, and session.
- Database Schema: A list of all tables along with their columns, indexes, and foreign keys, with a resilient connection mechanism.
- Model Structure: Extracts all Eloquent models, including properties (
$fillable,$casts, etc.) and their defined Eloquent relationships. - Route List: All web and API routes, including methods, URIs, and middleware.
- Scheduled Commands: A list of all cron jobs defined in your Console Kernel.
- Event Listeners: A map of all registered events and their corresponding listeners.
- Composer Dependencies: A list of packages used in the project.
- FilamentPHP Structure (if detected): Automatically discovers panels, resources, pages, and widgets.
💿 Installation
You can install the package via Composer:
composer require araminco/laravel-ai-mapper
🚀 Usage
To generate the project map, run the following Artisan command:
php artisan ai:map
This will create a file named ai-project-map.json in your project's root directory.
Controlling the Output Size
You can control the size and content of the map using the following options.
Compact Mode
Use the --compact flag to generate a summarized version that is significantly smaller. This mode simplifies verbose sections like the database schema and routes.
php artisan ai:map --compact
Excluding Sections
You can also completely exclude sections from the map:
--no-db: Excludes the database schema.--no-files: Excludes the directory structure.--no-models: Excludes the model analysis.--no-routes: Excludes the route list.--no-deps: Excludes composer dependencies.--no-filament: Excludes the Filament structure.--no-env: Excludes environment details.--no-schedule: Excludes scheduled commands.--no-events: Excludes event listeners.
📄 Output Sample
The generated JSON file will have a structure similar to this:
{
"projectName": "My Laravel App",
"laravelVersion": "12.0.0",
"environment": {
"environment": "local",
"debug_mode": true,
"cache_driver": "file",
"queue_connection": "sync",
"session_driver": "file"
},
"databaseSchema": { "...": "..." },
"models": [
{
"class": "App\\Models\\User",
"table": "users",
"relationships": { "...": "..." }
}
],
"routes": [ "...": "..." ],
"scheduledCommands": [
"$schedule->command('inspire')->hourly();"
],
"eventListeners": {
"Illuminate\\Auth\\Events\\Registered": [
"Illuminate\\Auth\\Listeners\\SendEmailVerificationNotification"
]
},
"filament": { "...": "..." }
}
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📜 License
This package is open-sourced software licensed under the MIT license.
araminco/laravel-ai-mapper 适用场景与选型建议
araminco/laravel-ai-mapper 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16 次下载、GitHub Stars 达 2, 最近一次更新时间为 2025 年 08 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 araminco/laravel-ai-mapper 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 araminco/laravel-ai-mapper 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-20