NEW Package Laravel Brain: Visualize your Codebase to Understand It Better

Laravel Daily| 00:06:03|May 7, 2026
Chapters6
Introduces the Laravel Brain package and its goal of helping you understand a new codebase quickly.

Laravel Brain helps you quickly visualize and explore a codebase with diagrams, exporters, and AI-assisted context, tested on small and larger Laravel projects.

Summary

Laravel Daily’s video showcases the new Laravel Brain package by Abdel Rahman, focusing on how it visualizes a codebase to help you understand unfamiliar projects. The presenter walks through installing the package with composer require and running brain scan on a fresh Spectacular clone, showing a dashboard where you can click console commands, routes, controllers, and methods to reveal complexity, statements, and parameters. He demonstrates navigating from a route to a controller and then into the method, including a glimpse of service calls and private methods. The video also evaluates Brain on a bigger project with Filament admin, highlighting more useful insights like a detailed store method, service interactions, and database queries. Visual layout options are discussed—breadcrumb, circle, grid, vertical vs. horizontal layouts—with the original hierarchical layout often appearing most effective. Export features are covered too: PNG exports, Mermaid compatibility, and AI-oriented exports like AI rules and AI context for editors or agents, plus a tip about enabling HTTPS to copy AI context into Visual Studio. The author notes that Laravel Brain is actively maintained, with the creator engaging on Twitter and releasing new features post-launch. He invites viewers to share alternatives and experiences in the comments. Overall, the video is a practical walk-through showing how Brain can turn code structure into an interactive diagram that accelerates codebase onboarding and analysis.

Key Takeaways

  • Install and try Laravel Brain quickly by running composer require ... and brain scan to generate the visual graph for a given Laravel project.
  • On a small project, Brain reveals routes, controllers, and methods with clickable details like complexity, statements, and parameters.
  • On a larger project with Filament, Brain highlights deeper paths such as store methods, service calls, and private methods, offering clearer comprehension of data flow.
  • You can export the diagram to PNG or Mermaid, and you can generate AI rules or AI context for your editor or AI agents.
  • Layout options include breadcrumb, circle, grid, and vertical/horizontal modes; the original hierarchical view is often the most readable.
  • HTTPS may be required for copying AI context to clipboard; switching to HTTPS fixes the copy issue.
  • Abdel Rahman and the Laravel Brain project maintain an active presence on Twitter, suggesting ongoing improvements after launch.

Who Is This For?

Essential viewing for Laravel developers who want a faster onboarding experience on new codebases, especially those who work with Laravel Brain or are curious about visualizing complex flows in projects using Laravel and Filament.

Notable Quotes

""the main purpose of that package as I understand it is to understand your project or understand a new project that you started working on.""
Defines the core goal of Laravel Brain as a project comprehension tool.
""you can export any graph to Mermaid or PNG.""
Shows export capabilities for sharing diagrams.
""it would generate cloud MD and other agents MD for various AI agents""
Mentions AI-related exports for AI-assisted workflows.
""the original hierarchical was the best""
Notes preferred layout option for readability.
""he was active launching new feature and actively replying to comments""
Comments on the creator’s community activity and ongoing development.

Questions This Video Answers

  • How does Laravel Brain help you understand a Laravel project faster by visualizing routes, controllers, and methods?
  • Can I export Laravel Brain diagrams to PNG or Mermaid for documentation?
  • What are the best layout styles in Laravel Brain for large codebases with Filament?
Laravel BrainAbdel RahmanLaravelFilamentMermaidPNG exportAI context exportAI rulesCode visualizationBrain scan
Full Transcript
Hello guys, in this video I want to show you a new package called Laravel Brain by Abdel Rahman which is taking the world of Laravel by storm. So this is a tweet with 400 likes and repository with 300 GitHub stars already and this package generates something like this. So this is kind of an official video by the author and in this video I will try it out myself. So the main purpose of that package as I understand it is to understand your project or understand a new project that you started working on. For example, you're assigned a project or you joining a team or you want to fix something in open-source project which is exactly what I will try. So recently I saw this on Reddit open source project spectacular and I do hunt for such open-source projects for various tips and analysis and reviews and I try to clone it. So this is the GitHub repository but let's imagine I want to quickly understand the codebase. So let's try to use Laravel brain for exactly that. According to the installation, this is my totally fresh spectacular cloned project composer require. And then we launch a command with intriguing name brain scan. So let's copy and I will paste it into a cleaned terminal. And what does it do? Oh, it was very quick because probably the project is pretty small. So we have the viewer at laravel-brain. And what does it show? Okay, we have some dashboard or well the result of our brain scan. And what do we have here? console commands of that project account password and I can click on various nodes and then read the details about that specific method for example routes web what do we have here invitations and then one invitation one route that goes to the controller which I can also click and see what's inside or I can zoom in or or zoom out and then I can click the method and in the method I see lines complexity statements and parameters method flow is even shown. So let's see what's inside. Well, that thing I can see in the code myself. So not that useful. So I guess the project itself is too small and too simple to use the power of Laravel brain. Let's try on another project. So I had this project to sell books. The catalog is empty but with filament admin panel and I installed Laravel brain on that and let's relaunch brain scan which has some more things and let's see what the brain says about this project console commands inspire so this is by default Laravel and route swab we have get again controller method and query source code is also here but again a lot of those things I can look in the code and this for example route is a bit more interesting. So controller method but then private method as I understand and this is for example even more interesting. So check out controller then store method then a few queries and then calling the service. So this is probably really useful like a diagram to understand what is happening inside of the main store method. So we have service which has private methods of checking something and then has the order query or stripe client construct. Also you can customize how that thing can look. So in the view you can change to bread first or circle it's kind of worse grid maybe. No the original one hierarchical was the best but also you can change between vertical and horizontal. In some cases, it may make sense to have horizontal and then fit to screen probably returns to the original position. Also, the package readme says that it has more feed like for example filament PHP support. I do have filament in this project, but for some reason it wasn't shown. Maybe I have to enable it somewhere than stuff like middleware mapping. I didn't have middleares here in my examples from what I understand. You can export any graph to Mermaid or PNG. Actually, let's try that one. Export PNG. And what does it show? Okay, we have a PNG. Great. Also, interesting things like route stress test. I haven't seen and haven't notice where is that button on the dashboard. Maybe I have to activate that. AI content export is some information for context for your AI agent. Let's actually try that as well. Generate AI rules. Also it would generate cloud MD and other agents MD for various AI agents also actually that was AI rules generation and AI context export is something different found it on the dashboard. So for controller there's an icon really small icon copy AI context to clipboard and if I copy that could not copy. Oh because I'm not secure it probably works with HTTPS only. So kind of a side tip, let's run her secure and then it should go through HTTPS. If I refresh that, it should be secure now. And that thing should work. So book controller. Yep, now it is copied. And if I paste it somewhere into Visual Studio, what is the result of that context for that controller? Maybe it's worth pasting. I'm not sure. Probably Laravel Boost has that context already for your project anyway. So yeah, you can explore other features of Laravel brain and try it out yourself. And also the author is pretty active on Twitter. So after the initial launch, he was active launching new feature and actively replying to comments. So yeah, he's really active and probably will spend more time improving the project on this core that is already implemented. Would you use Laravel brain or do you have some alternatives similar to that? Let's discuss as usual in the comments below. That's it for this time and see you guys in other

Get daily recaps from
Laravel Daily

AI-powered summaries delivered to your inbox. Save hours every week while staying fully informed.