Download the PHP package laramint/laravel-brain without Composer

On this page you can find all versions of the php package laramint/laravel-brain. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-brain

Visualize your Laravel application's full request lifecycle as an interactive graph.
Understand how routes, controllers, services, models, jobs, events, commands, and channels connect — in seconds.

Laravel PHP License Sponsor

Buy Me a Coffee


What is LaraMint\LaravelBrain?

LaraMint\LaravelBrain is a zero-config developer tool that analyzes your Laravel codebase and renders an interactive node graph of your application's architecture. It traces every route through its controller, services, repositories, models, jobs, events, Artisan commands, scheduled tasks, broadcast channels, and Filament panels — giving you a bird's-eye view of the entire application without reading a single line of code.

The scan writes JSON graph files to storage/app/laravel-brain/. The viewer is served at /_laravel-brain entirely through your existing Laravel routes — no separate server process needed.

Features

Requirements

Installation

Install as a dev dependency (it's a development tool, not needed in production):

Laravel will auto-discover the service provider. No manual registration needed.

Usage

Scan your project

This analyzes your entire codebase and writes the graph data to storage/app/laravel-brain/. When complete it prints the URL to open:

Memory limit

The scanner defaults to 1024M. On larger codebases you can raise the limit with --memory-limit:

Accepted formats: <number>M (megabytes), <number>G (gigabytes), or -1 (unlimited). The minimum allowed value is 1024M.

Export AI context for a node

Click the 🤖 button in the node sidebar to copy a structured Markdown context block to your clipboard, ready to paste into Claude, ChatGPT, or any LLM.

The context is deterministic: same scan + same node = identical output every time. It uses BFS up to depth 3 from the selected node and enforces a token budget (default 6 000 tokens), truncating only source snippets once structural metadata is fully included.

You can also run it from the terminal:

Or via the API:

The exported Markdown contains:


Generate AI assistant rules files

Populate context files for your AI coding tools directly from the scan data.

From the UI: Toolbar → ExportGenerate AI Rules → select targets → Generate.

From the terminal:

Target File written Used by
claude CLAUDE.md Claude Code CLI & IDE extension
cursor .cursor/rules/laravel-brain.mdc Cursor (MDC format with frontmatter)
windsurf .windsurf/rules/laravel-brain.md Windsurf by Codeium
copilot .github/copilot-instructions.md GitHub Copilot (applied repo-wide)
junie .junie/guidelines.md JetBrains AI / Junie
aider CONVENTIONS.md Aider (aider --read CONVENTIONS.md)
agents AGENTS.md Universal open standard — 60+ tools

Each generated file contains your project's tech stack, architecture counts, top routes, complexity hotspots, detected code smells, and full package lists. Re-run after every scan to keep the files current.


Watch mode

Re-scan automatically whenever a PHP file changes:

Open the viewer

Navigate to /_laravel-brain in your browser while your Laravel app is running (e.g. via php artisan serve).

How It Works

Route discovery

LaravelBrain recursively scans your entire routes/ directory — not just web.php and api.php. Any PHP file under routes/** is analyzed, including versioned files like routes/v1/users.php or module-specific files like routes/modules/admin.php.

Auto-discover mode

Set 'auto_discover_routes' => true in config/laravel-brain.php to skip AST parsing and pull routes from the live Laravel router (Route::getRoutes()) instead. This captures routes registered programmatically by service providers and packages (Filament, Sanctum, Livewire, Telescope, etc.) that the AST scanner can't see.

By default, routes whose handler (controller class or closure) lives under your project's vendor/ directory are excluded — so package-internal routes such as Telescope, Horizon, or Ignition stay out of the graph. Flip 'auto_discover_exclude_vendor' => false if you want them included.

Heads up: in auto-discover mode the source file and line number of each route are not available, so the sidebar will not group routes by their declaring file (everything falls under a single group). Use the default AST mode if file/line grouping matters to you.

Call chain tracing

From each controller action (and Filament page method), the tracer follows:

This produces the full edge list used to build the graph.

Filament PHP support

When Filament is installed, the scanner discovers every panel registered via service providers, then resolves its resources, pages, widgets, and relation managers — both explicitly listed (->resources([...])) and auto-discovered (->discoverResources(for: '...')). Filament page methods are traced through the same call-chain engine as controller actions, so models and services they touch appear in the graph.

Graph Node Types

Node Accent Color Represents
Route Green #4CAF50 HTTP endpoint (GET /users)
Middleware Orange #FF9800 Middleware applied to a route
Controller Blue #2196F3 Controller class
Action Light Blue #03A9F4 Controller method
Service Purple #9C27B0 Service or helper class
Model Red #F44336 Eloquent model
Event Yellow #FFD600 Laravel event
Job Slate #607D8B Queued job
Filament Panel Violet #7C3AED Filament panel definition
Filament Resource Purple #A855F7 Filament resource class
Filament Page Lavender #C084FC Filament page class
Filament Page Method Pink #E879F9 Method on a Filament page
Filament Widget Cyan #06B6D4 Filament widget class
Filament Relation Manager Teal #0891B2 Filament relation manager

Note: Command, Schedule, Channel, and Repository nodes are discovered and added to the graph but use the closest matching accent color from their parent type.

Viewer Shortcuts

Action How
Zoom Scroll wheel
Pan Click + drag on canvas
Inspect node Click any node
View source Click a node → Source tab in sidebar
Source popup Click ⤢ in source section to open focused view
View flowchart Click a class node → Flow tab
Flowchart popup Click ⤢ in flow section to open large view
View sequence diagram Click a route node → Sequence Diagram section in sidebar
Filter by type Filter panel on the left
Fit all nodes Toolbar → Fit button
Export PNG Toolbar → Export → Download PNG
Export Mermaid Toolbar → Export → Copy Mermaid Code
Generate AI rules Toolbar → Export → Generate AI Rules
Toggle theme Toolbar → ☀️ / 🌙 button
Copy AI context Click any node → 🤖 button in sidebar header
Stress test a route Click a route node → open Stress Test in the sidebar → set options → Run

Routes Registered

The package registers the following routes in your application (all under the /_laravel-brain prefix):

Stress testing uses laramint/laravel-stress, which is installed automatically as a dependency. Target URLs are validated server-side against an allowlist of development hosts: localhost, 127.0.0.1, *.test, *.local, *.ddev.site, single-label Docker service names (e.g. nginx, app), private IPv4 ranges (10.x, 172.16–31.x, 192.168.x), and the host in APP_URL.

Docker and stress testing

Docker? The stress test subprocess runs inside the container — localhost:8080 is the host-side mapped port and won't be reachable there. Change the Base URL field to the internal service address, e.g. http://nginx or http://localhost:80.

Single-label hostnames (Docker service names with no dots) and private IPv4 ranges are automatically allowed by the host validator, so pointing the Base URL at your internal network address will work without any extra config.

Output Files

After running brain:scan, the following files are written to storage/app/laravel-brain/:

These files are regenerated on every scan and are safe to gitignore:

Security

The /_laravel-brain routes are only registered in the local environment by default. Since it's a require-dev dependency, it will not be present in production builds (composer install --no-dev).

If you do install it in a non-production environment accessible over a network, consider protecting the routes with middleware.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you'd like to change.

Tests:

License

MIT — see LICENSE for details.


All versions of laravel-brain with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
nikic/php-parser Version ^5.0
illuminate/console Version ^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^9.0|^10.0|^11.0|^12.0|^13.0
laramint/laravel-stress Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package laramint/laravel-brain contains the following files

Loading the files please wait ...