Skip to content
TraceStax Docs

PHP / Laravel

The TraceStax PHP SDK supports Laravel Queues and Symfony Messenger. A single package handles both.

  • PHP 8.1+
  • Laravel 10.x / 11.x, or Symfony 6.x / 7.x
Terminal window
composer require tracestax/tracestax-php

The package auto-discovers itself via Laravel’s package discovery. Add your API key to .env:

TRACESTAX_API_KEY=ts_live_xxxxxxxxxxxx

Then publish the config (optional):

Terminal window
php artisan vendor:publish --tag=tracestax-config

The SDK registers a JobProcessing, JobProcessed, and JobFailed listener automatically. No changes to your job classes are needed.

Queue Worker:

Terminal window
php artisan queue:work --queue=default,high

Events flow as soon as the worker starts.


OptionEnv varDefaultDescription
api_keyTRACESTAX_API_KEYRequired
worker_idTRACESTAX_WORKER_IDhostname + PIDWorker identifier
enabledTRACESTAX_ENABLEDtrueSet to false in tests
ingest_urlTRACESTAX_INGEST_URLhttps://ingest.tracestax.comCustom endpoint
timeout3HTTP timeout in seconds

.env.testing
TRACESTAX_ENABLED=false

Or in a test service provider:

Config::set('tracestax.enabled', false);

Events not appearing (Laravel)

Confirm the queue worker process has TRACESTAX_API_KEY in its environment. If you’re using Laravel Horizon, add it to the horizon process env in your supervisor config, not just the web .env.