Download the PHP package zerethonapp/flow-laravel without Composer
On this page you can find all versions of the php package zerethonapp/flow-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zerethonapp/flow-laravel
More information about zerethonapp/flow-laravel
Files in zerethonapp/flow-laravel
Package flow-laravel
Short Description Laravel instrumentation adapter for Flow real trace capture.
License MIT
Informations about the package flow-laravel
flow-laravel
Laravel instrumentation adapter for Flow Phase 3 & 4 (real runtime traces).
Want to see it running before installing anything?
flow-laravel-demo is a
runnable Laravel app with 7 instrumented demo routes — clone it, composer install, and hit a route to see a real captured trace.
Contributing? See CONTRIBUTING.md. Found a security issue? See SECURITY.md, not a public issue. Release history: CHANGELOG.md. This project follows the Contributor Covenant.
Why Flow?
Most developers:
- ❌ Optimize database first (without proof)
- ❌ Guess bottlenecks based on intuition
- ❌ Rely on generic monitoring tools
Flow shows the REAL bottleneck instantly:
- ✅ Identifies actual slow operations
- ✅ Prevents wasted optimization effort
- ✅ Provides clear, explainable insights
Real Example
Your request takes 100ms. Where's the bottleneck?
Without Flow:
- Maybe add database index? 🤔
- Cache everything? 🤔
- Optimize queries? 🤔
With Flow:
Conclusion: Database is NOT the problem. Focus on service logic instead.
What this package does
- Zero-config: Automatically captures HTTP requests after install
- Captures one real Laravel HTTP request as a Flow trace
- Produces real nodes and edges from runtime execution
- Stores trace records in
.zerethon/flow-history.json(CLI-compatible format) - Supports manual service/external instrumentation for v1 practicality
- Captures database query timings through Laravel's DB listener
Scope (v1)
Included:
- request lifecycle node
- controller scoped node
- database query nodes
- manual service traces (
Flow::trace(...)) - manual external traces (
Flow::external(...)) - JSON storage compatible with
flow-cli scan/analyze
Not included yet:
- distributed tracing
- queue/job tracing
- automatic service discovery
- UI/dashboard
Install
That's it! Flow will now automatically trace HTTP requests in every environment except testing.
Hit any route:
Check the trace:
Or browse individual traces:
Zero-Config Experience
By default, Flow:
- ✅ Automatically registers middleware globally
- ✅ Captures all HTTP requests (web + api)
- ✅ Captures controller execution
- ✅ Captures database queries
- ✅ Writes traces to
.zerethon/flow-history.json - ✅ Runs everywhere except
testing(production included by default — see Connected Mode below)
No code changes required.
Connected Mode (Push Traces to Flow)
By default, traces only ever land in the local .zerethon/flow-history.json
file above (Offline mode) — nothing leaves your machine/server unless you
configure Connected mode. To have every captured trace pushed automatically
to Flow, get a project's credentials from the Flow dashboard (shown once, at
project creation) and add them to .env:
Then verify it's wired up correctly:
That's it — no other code changes. Traces still write to the local file too (Connected mode is additive, not a replacement); if any of the three env vars are missing, Flow just skips the push silently and behaves exactly as it did before.
Production is enabled by default (except_environments only excludes
testing, see Configuration below) — the three FLOW_* env vars above are
all that's needed on a real deployed environment. If you want Flow off in a
specific environment (e.g. a staging server you don't want traced),
publish the config (php artisan vendor:publish --tag=flow-config) and add
that environment to except_environments — this check runs before
anything else in FlowServiceProvider::boot(), so an excluded environment
gets zero overhead, not just a silenced push.
Building an adapter for a different language/framework?
flow-docs/ADAPTER_PROTOCOL.md documents the exact wire contract this
package's push implements — it's plain HTTP+JSON, no PHP/Laravel-specific
mechanism involved.
Configuration (Optional)
Publish config if you want to customize behavior:
The published config file at config/flow.php provides fine-grained control:
Enable/Disable
Sources
Control which data sources are active:
Source Options
Configure behavior per source:
Storage
Enable request capture middleware
Add middleware alias flow.trace to routes you want to capture.
Example:
Manual service and external tracing
Use the Facade:
Or use the global helper:
Generic trace method:
Assisted Tracing
Flow provides multiple ways to make tracing easier and less verbose:
Using the Traceable Trait
Add the trait to your service classes:
Using PHP Attributes (Future)
Note: Attribute-based tracing requires additional AOP/interceptor setup and is not yet fully implemented.
Output format
Traces are appended to:
.zerethon/flow-history.json(default)
Record shape matches Flow core storage:
traceIdtimestampflow(schema_version,trace_id,nodes,edges,meta)result(status,totalTime,nodeCount,executedNodes, optionalerrors)
Analyze with existing CLI
From the Laravel app root (where .zerethon/flow-history.json exists):
Raw JSON mode:
Demo scenario (real request trace)
Use middleware + manual service/external blocks:
Then call the route once and run:
Config
config/flow.php
enabledstorage_pathmax_recordscapture_controllercapture_query_sql
All versions of flow-laravel with dependencies
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0