Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Brain

Laravel Brain Laravel Package

laramint/laravel-brain

Laravel Brain is a zero-config tool that maps your app's full request lifecycle as an interactive graph, tracing routes, controllers, services, models, jobs, events, commands, channels, and Filament panels. It writes JSON to storage and serves a viewer at /_laravel-brain.

View on GitHub
Deep Wiki
Context7

LaraMint\LaravelBrain is a zero-config tool that renders an interactive node graph of your Laravel app's full request lifecycle — tracing routes through controllers, services, repositories, models, events, jobs, commands, scheduled tasks, channels, and Filament panels. Graph JSON lands in storage/app/laravel-brain/ and is served at /_laravel-brain via your existing routes, with no separate server process.

  • Full lifecycle tracing — route → controller → service → repository → model → events/jobs
  • Listener discovery — convention, $listen/$subscribe, and #[AsEventListener]
  • Unresolved dispatch detection — flags dispatches that can't be resolved statically
  • Filament support — panels, resources, pages, widgets, relation managers
  • Zero config — Laravel 9–13, PHP 8.0+
Frequently asked questions about Laravel Brain
How do I install LaraMint Laravel Brain?
Install it as a dev dependency with composer require --dev laramint/laravel-brain, then run php artisan brain:scan to generate the graph. The package uses Laravel service provider auto-discovery, so no manual registration or route changes are needed. Once scanned, open /_laravel-brain in your browser to view the interactive graph.
Which Laravel and PHP versions does Laravel Brain support?
Laravel Brain supports Laravel 9, 10, 11, 12, and 13, and requires PHP 8.0 or newer. It is built specifically for Laravel's conventions and requires no framework modifications. Check the repository for the latest compatibility notes before upgrading major versions.
Does Laravel Brain work in production?
Laravel Brain is intended as a dev-only tool and should be installed with --dev so it does not add production bloat. Scans run as CLI commands and write static JSON graph files, so there is no runtime overhead in your application. The viewer is served at /_laravel-brain, so exclude that path at your web server or protect it with middleware such as auth:sanctum before exposing it outside local development.
How do I visualize my Laravel routes, controllers, and models with Laravel Brain?
Run php artisan brain:scan and the package traces routes through controllers, services, repositories, models, jobs, events, commands, channels, and Filament panels, then writes the graph to storage/app/laravel-brain. The interactive viewer is served through your existing Laravel routes at /_laravel-brain, so no separate server process or port is required. Open the viewer to explore the request lifecycle as a node graph.
What happens if Laravel Brain hits memory limits on a large codebase?
Large applications may exceed the default 1GB PHP memory limit during a scan. Use the --memory-limit flag to raise the limit, or enable auto-discover mode, which lowers memory usage by trading away some file and line metadata. Auto-discover can make programmatically registered routes harder to trace back to source files, so validate critical paths.
Does Laravel Brain support Filament panels and resources?
Yes, Laravel Brain integrates with Filament 2 and 3 and discovers panels, resources, pages, widgets, and relation managers. It traces call chains from Filament pages and resources into your application code. If your app does not use Filament, you can disable that analyzer to keep scans focused.
Can I run Laravel Brain scans in CI/CD pipelines?
Yes, you can add php artisan brain:scan to a CI job such as GitHub Actions. Use a flag like --memory-limit=2G on larger projects to avoid scan failures. Monitor scan times if you run scans on every commit, because auto-watch mode and large codebases can add noticeable overhead.
How do I export Laravel Brain's graph for documentation or LLM context?
Use php artisan brain:export-context --output=docs/architecture.md to export the graph context into a documentation file. This is useful for architecture docs or LLM-assisted refactoring prompts. For complex nodes, validate token budgets before feeding the output into a model.
How does Laravel Brain compare to Laravel Telescope or Horizon?
Laravel Brain is complementary to Telescope and Horizon rather than a replacement. Telescope and Horizon observe runtime requests, jobs, and queues, while Laravel Brain statically analyzes and visualizes your application architecture before runtime. Many teams use both: Brain for architecture maps and Telescope or Horizon for live debugging.
Why are some routes or dispatch call chains missing from the Laravel Brain graph?
Routes registered programmatically inside service providers may not map to source files when auto-discover mode is enabled. Dynamic calls such as call_user_func can also cause false positives or false negatives in call-chain tracing. Use the --auto-discover option for programmatic routes and manually validate critical paths that matter most.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections