Download the PHP package quitscope/laravel-flow-tracer without Composer

On this page you can find all versions of the php package quitscope/laravel-flow-tracer. 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-flow-tracer

Laravel Flow Tracer

An Artisan command that shows what happens behind a route: which middleware runs, which controller method handles it, and which services and models that method touches. You get the result as a table, as JSON, or as a diagram.

I built it because I kept opening five files just to answer "what does this endpoint actually do?" in larger projects. Now it's one command.

 

Requirements

Installation

The service provider is registered through package discovery.

Graphviz, if you want images:

Check it with dot -V. On Windows the package looks for C:\Program Files\Graphviz\bin\dot.exe, everywhere else it calls dot from your PATH. If yours lives somewhere else, publish the config and set graphviz.dot_path.

Usage

Pick a starting point:

By default this prints the tables and writes a PNG to storage/app/flow-diagrams. Skip the image with --no-png.

Some more examples:

The Mermaid output for the screenshot above is in docs/examples/flow-example.mmd. GitHub renders it if you put it in a mermaid code block.

All options

Option What it does
--route= Trace a named route
--url= Trace a URL path (tries GET, POST, PUT, PATCH, DELETE)
--action= Trace Class@method, or an invokable class
--format= table (default) or json
--no-png Don't write the default PNG
--output= Path for the default PNG
--export= Extra output: png, svg, dot or mermaid
--forward Classes the controller depends on
--backward Classes that depend on the controller
--impact Dependency counts and a risk level
--circular Look for circular dependencies
--depth=3 Depth for --forward / --backward
--internal Show internal method calls of the controller method
--show-params Include parameters (with --internal)
--deep Keep following detected classes
--max-deep=10 Limit for --deep
--stats Count controllers, services, models and actions
--scan= Directory for --stats (defaults to the project root)
--debug-connections Print what --deep detects and why

Configuration

The settings that matter:

Key Default
output_directory storage_path('app/flow-diagrams')
graphviz.dot_path null (auto)
graphviz.dpi 300
graphviz.size null

How it works (and where it falls short)

The route part comes straight from Laravel's router, so route, middleware and controller are exact. Everything below the controller is found by reading the source of the controller method: constructor dependencies, new SomethingService(), SomethingAction::run(), Model::find() and so on. Classes are recognised by name suffixes like Service, Action, Query, Repository and Handler.

So this is a static, best-effort view. Calls behind facades, container lookups or dynamic method names won't show up, and classes that don't follow those naming conventions can be missed. For getting an overview of an unfamiliar codebase it has been good enough for me. Issues and PRs for better detection are welcome.

Troubleshooting

Image export fails with "cannot find the path" or "dot: command not found" Graphviz isn't installed or not where the package expects it. Set graphviz.dot_path, or use --no-png.

"Route ... not found" --route wants the route name, not the URI. Use --url for paths. php artisan route:list shows both.

Out of memory on big projects php -d memory_limit=512M artisan flow:trace ...

Tests

License

MIT, see LICENSE.md.


All versions of laravel-flow-tracer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/console Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.0
symfony/finder Version ^6.0|^7.0
symfony/process Version ^6.0|^7.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 quitscope/laravel-flow-tracer contains the following files

Loading the files please wait ...