Search by

relaylayerio / laravel-inbound

erichob

Report Laravel exceptions, failed jobs, and scheduler heartbeats to RelayLayer inbound events.

v0.1.1 2026-09-23 18:57 UTC

This package is not auto-updated.

Last update: 2026-09-24 01:24:08 UTC


README

Report Laravel application events to RelayLayer’s inbound API (POST /api/v1/events) with almost no app-specific code.

Works with Laravel 10–13. Use an inbound source token (rl_src_…), not a notification API key (rl_live_ / rl_test_).

This package covers the app layer (exceptions, failed jobs, scheduler). CSF/LFD still uses the server helpers in docs/examples/.

Install

From Packagist (when published):

composer require relaylayerio/laravel-inbound

In-house path install (RightwayParking, Cedar & Steel, and other apps next to this repo):

{
    "repositories": [
        {
            "type": "path",
            "url": "../in_house/relaylayer/packages/laravel-inbound",
            "options": { "symlink": true }
        }
    ],
    "require": {
        "relaylayerio/laravel-inbound": "@dev"
    }
}

Then:

composer require relaylayerio/laravel-inbound:@dev
php artisan vendor:publish --tag=relaylayer-inbound-config

RelayLayer dashboard

  1. Open the project → Server events.
  2. Create a source of type Laravel.
  3. Copy the one-time rl_src_… token.
  4. Add emails on Recipients if people should be notified.

Minimal .env

RELAYLAYER_INBOUND_URL=https://api.relaylayer.io/api/v1/events
RELAYLAYER_INBOUND_TOKEN=rl_src_...
RELAYLAYER_HOSTNAME=rightwayparking.com
RELAYLAYER_INBOUND_ENABLED=true

RELAYLAYER_URL / RELAYLAYER_TOKEN are also accepted so you can reuse a CSF-style env file.

No bootstrap/app.php changes are required. The service provider auto-discovers.

Keep a queue worker running (php artisan queue:work). Outbound POSTs are queued so checkout and other requests are not blocked. Keep the Laravel scheduler running so app.scheduler_ok heartbeats fire.

What is reported automatically

HookEventDefault severityRouting on RelayLayer
Unhandled exceptionsapp.exceptionerrorImmediate
Failed queue jobsapp.queue_failederrorImmediate
Scheduler heartbeatapp.scheduler_okinfoHourly digest
php artisan relaylayer:inbound-heartbeat --staleapp.scheduler_stalewarningImmediate

Validation errors, 401/403/404/419/422/429, and this package’s own delivery job are not reported.

Custom events

use RelayLayer\LaravelInbound\Facades\RelayLayer;

RelayLayer::event('app.payment_failed', 'error', 'Stripe charge declined', [
    'order_id' => $order->id,
    'gateway' => 'stripe',
]);

// or
relaylayer('app.payment_failed', 'error', 'Stripe charge declined', [
    'order_id' => $order->id,
]);

Event names must look like app.something (source.detail). Cookies, Authorization, tokens, and card-ish keys are redacted before the payload is queued.

Config toggles

EnvDefaultPurpose
RELAYLAYER_INBOUND_ENABLEDtrueMaster switch
RELAYLAYER_INBOUND_REPORT_EXCEPTIONStrueException hook
RELAYLAYER_INBOUND_REPORT_FAILED_JOBStrueQueue::failing
RELAYLAYER_INBOUND_HEARTBEATtrueScheduled pulse
RELAYLAYER_INBOUND_HEARTBEAT_MINUTES10Pulse interval
RELAYLAYER_INBOUND_QUEUEdefaultQueue name for the outbound POST

Failed deliveries are retried, then appended to storage/logs/relaylayer-inbound-spool.jsonl.

Tests

cd packages/laravel-inbound
composer install
vendor/bin/pest