tracebeat / laravel
Connect a Laravel application to TraceBeat. A thin layer over laravel/nightwatch that points the agent at your TraceBeat server.
Requires
- php: ^8.2
- illuminate/console: ^10.0|^11.0|^12.0|^13.0
- illuminate/http: ^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
- laravel/nightwatch: ^1.30
Requires (Dev)
- laravel/pint: ^1.0
- orchestra/testbench: ^8.0|^9.0|^10.0|^11.0
- pestphp/pest: ^3.0|^4.0|^5.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Connects a Laravel application to your own TraceBeat server. It is a thin layer over the official laravel/nightwatch package: the same sensors and agent, pointed at your server.
Install
composer require tracebeat/laravel php artisan tracebeat:install --url=https://tracebeat.example.com --token=YOUR_ENVIRONMENT_TOKEN php artisan tracebeat:status php artisan tracebeat:agent
Keep tracebeat:agent running under Supervisor, systemd or a Forge daemon.
Commands
| Command | What it does |
|---|---|
tracebeat:install |
Publishes config/nightwatch.php (reads TRACEBEAT_TOKEN) and writes TRACEBEAT_URL and TRACEBEAT_TOKEN to .env |
tracebeat:agent |
Runs the Nightwatch agent against your TraceBeat server |
tracebeat:status |
Authenticates against /api/agent-auth and explains any failure |
tracebeat:deploy |
Sends deploy metadata so charts can mark deploys |
Mail content
The Nightwatch agent only reports a mail's subject and recipient counts. This package also sends the content of each outgoing mail (body, addresses, attachment list) to TraceBeat, so you can preview exactly what was sent, like Telescope's Mail tab. TraceBeat stores it only when the environment has Store mail content switched on, and only owners and admins can read it. Turn it off in the application with TRACEBEAT_CAPTURE_MAIL=false, or change what leaves the app:
use TraceBeat\Laravel\Mail\MailCapture; MailCapture::redactUsing(function (array $mail) { $mail['html'] = preg_replace('/token=[^"&]+/', 'token=***', $mail['html']); return $mail; // return null to skip a mail entirely });
All NIGHTWATCH_* options (sampling, filtering, redaction) keep working. Existing Nightwatch installs can also keep NIGHTWATCH_TOKEN and NIGHTWATCH_BASE_URL and skip this package entirely.