beemlabs / beem-laravel
Laravel 11/12 integration for the Beem SDK — auto-traces HTTP, DB queries, queue, console, and captures exceptions.
Requires
- php: >=8.2
- beemlabs/beem-php: ^0.1
- illuminate/contracts: ^11.0 || ^12.0
- illuminate/database: ^11.0 || ^12.0
- illuminate/events: ^11.0 || ^12.0
- illuminate/http: ^11.0 || ^12.0
- illuminate/support: ^11.0 || ^12.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.75
- laravel/framework: ^11.0 || ^12.0
- orchestra/testbench: ^9.0 || ^10.0
- pestphp/pest: ^3.0
Suggests
- illuminate/console: For console command instrumentation
- illuminate/queue: For queued job instrumentation
README
Laravel 11/12 integration for the Beem SDK — auto-traces HTTP requests, database queries, queued jobs, and console commands, and captures unhandled exceptions.
Requirements
- PHP 8.2+
- Laravel 11 or 12
beemlabs/beem-php(installed automatically)
Installation
composer require beemlabs/beem-laravel
The service provider is auto-discovered. Set your DSN in .env:
BEEM_DSN=https://pk_abc123@beem.example.com/shop-api
That's it — HTTP, DB, queue, and console instrumentation are on by default.
Configuration
Publish the config file if you need more than the env defaults:
php artisan vendor:publish --tag=beem-config
Environment variables:
| Variable | Default | Description |
|---|---|---|
BEEM_DSN |
— | Project DSN (empty disables the SDK) |
BEEM_SAMPLE_RATE |
1.0 |
Fraction of transactions to record |
BEEM_MAX_BATCH_SIZE |
500 |
Events buffered before an automatic flush |
BEEM_FLUSH_TIMEOUT_MS |
2000 |
HTTP transport timeout per flush |
BEEM_ENVIRONMENT |
APP_ENV |
Environment tag on every event |
BEEM_RELEASE |
null |
Release/version tag on every event |
BEEM_INSTRUMENT_HTTP |
true |
Trace HTTP requests via middleware |
BEEM_INSTRUMENT_DB |
true |
Record db.query spans for Eloquent/DB queries |
BEEM_INSTRUMENT_QUEUE |
true |
Trace queued job execution |
BEEM_INSTRUMENT_CONSOLE |
true |
Trace artisan commands |
What gets traced
- HTTP — one transaction per request, named after the matched route (
GET /orders/{id}), with the response status. - Database — every query becomes a
db.queryspan on the current transaction. - Queue — each processed job runs in its own transaction.
- Console — each artisan command runs in its own transaction.
- Exceptions — unhandled exceptions are captured and linked to the active transaction.
Manual instrumentation is available through the core SDK's Beem\Beem facade — see the beem-php README.
Development
composer install composer test # Pest + Orchestra Testbench composer cs:check # php-cs-fixer (dry-run) composer cs:fix # php-cs-fixer
This repository is a read-only split of the Beem monorepo. Please open issues and pull requests there — direct pushes here are overwritten by the next sync.
License
MIT