zerofyi/laracontext

Generate high-density architectural context maps of Laravel applications for AI models.

Maintainers

Package info

github.com/zerofyi/laracontext

pkg:composer/zerofyi/laracontext

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-06-20 16:59 UTC

This package is auto-updated.

Last update: 2026-06-20 17:05:07 UTC


README

Latest Version on Packagist Total Downloads Software License PHP Version Support

LaraContext is a high-density architectural blueprint compiler engineered specifically for Laravel applications.

Instead of dumping raw repositories into LLM windows and blowing past token limits, LaraContext parses live framework structures in memory via Reflection engines to provide AI assistants with maximum architectural insight for minimum token consumption.

🔥 Key Features

  • Dynamic Schema Inspection: Sniffs database drivers natively to list tables, field sets, and casting data types instantly without crashing on unmigrated structures.
  • Deep Reflection Extraction: Traverses Eloquent models dynamically to map public relationship graphs (hasMany, belongsTo, etc.).
  • Automated Validation Injections: Maps controller action definitions to resolve injected FormRequest validation rules, creating field-level request documentation for the AI.
  • Fail-Safe Containment: Gracefully falls back past unresolvable bindings or custom parameters, continuing the blueprint without killing the run.

💾 Installation

composer require zerofyi/laracontext

The package relies on Laravel's standard auto-discovery protocols out of the box.

🚀 Usage

Compile the application's context blueprint:

php artisan context:generate

This generates a high-density, structured Markdown profile named ai-context.md right in the root working directory of your host application.

Flag Description
--output=custom.md Overrides the default file name and target destination path.
--no-routes Bypasses endpoint mapping loops to ensure maximum token space containment.

📄 License

The MIT License (MIT). Please see the License File for more details.