Laravel with AllStak

Add automatic error, request, and query monitoring to your Laravel app. The service provider auto-discovers — no code changes are required.

Source repository:
AllStak/allstak-php-sdk
Source README:
README.md
SDK version:
1.4.0
Installation source:
Packagist
Last verified:
2026-05-31

Installation

Install via Composer.

composer require allstak/sdk-php

Configuration

Add your API key to the environment. Optionally publish the config to customize capture options.

ALLSTAK_API_KEY=ask_live_xxx
ALLSTAK_ENVIRONMENT=production
[email protected]

# optional:
# php artisan vendor:publish --tag=allstak-config

Basic example

After composer require and one API key, the app is fully instrumented with no code changes — the service provider is auto-discovered.

Capturing errors

Unhandled exceptions are captured automatically. Capture handled ones via the Facade.

use AllStak\Facade;

Facade::captureError(new RuntimeException('checkout failed'));
Facade::captureLog('info', 'payment retry', ['orderId' => 'ord_123']);

Tracking requests

Inbound requests are captured by global middleware when ALLSTAK_CAPTURE_REQUESTS is true, and database queries via DB::listen when ALLSTAK_CAPTURE_DB is true — both automatic, no user call.

Best practices

  • Keep ALLSTAK_API_KEY in .env, never committed.
  • Set ALLSTAK_ENVIRONMENT so staging and production stay separate.
  • Keep ALLSTAK_CAPTURE_DB enabled to catch slow database queries.