Integration

Beacon for Laravel

Monitor uptime, report incidents, and update component status — all from your Laravel app. One package. Zero config.

$ composer require beacon-status/laravel

Quick Start

Up and running in three steps

1

Install

composer require beacon-status/laravel
2

Configure

Add your credentials to .env

BEACON_API_TOKEN=your-token
BEACON_BASE_URL=https://api.beacon.example.com
BEACON_PAGE_SLUG=main
3

Publish config

php artisan vendor:publish --tag=beacon-config

Code Examples

Speak fluent Laravel

Report an Incident

Create an incident on your status page from anywhere in your app.

use BeaconStatus\Laravel\Facades\Beacon;

Beacon::createIncident([
    'title'   => 'Database connection errors',
    'impact'  => 'major',
    'state'   => 'investigating',
    'message' => 'Elevated connection timeouts from primary DB.',
]);

Update Component Status

Beacon::updateComponent($componentId, [
    'status' => 'degraded',
]);

Resolve an Incident

Beacon::resolveIncident($incidentId,
    'Database connections restored after failover.'
);

Heartbeat for Scheduled Tasks

// In your scheduler
$schedule->command('invoices:process')
    ->hourly()
    ->after(function () {
        Beacon::heartbeat('invoice-processing-token');
    });

Exception Handler Integration

// In bootstrap/app.php
->withExceptions(function (Exceptions $exceptions) {
    $exceptions->report(function (Throwable $e) {
        if ($e instanceof CriticalDatabaseException) {
            Beacon::createIncident([
                'title'  => 'Critical database failure',
                'impact' => 'critical',
            ]);
        }
    });
})

Reference

Configuration

// config/beacon.php

return [

    /*
    |--------------------------------------------------------------------------
    | API Token
    |--------------------------------------------------------------------------
    |
    | Your Beacon API token. Generate one from the workspace settings page.
    |
    */

    'token' => env('BEACON_API_TOKEN'),

    /*
    |--------------------------------------------------------------------------
    | Base URL
    |--------------------------------------------------------------------------
    |
    | The base URL of your Beacon instance API.
    |
    */

    'base_url' => env('BEACON_BASE_URL', 'https://api.beacon.example.com'),

    /*
    |--------------------------------------------------------------------------
    | Page Slug
    |--------------------------------------------------------------------------
    |
    | The default status page slug to use for API calls.
    |
    */

    'page_slug' => env('BEACON_PAGE_SLUG', 'main'),

    /*
    |--------------------------------------------------------------------------
    | Queue
    |--------------------------------------------------------------------------
    |
    | Send API calls via queue for non-blocking operation. Set to false
    | to send synchronously.
    |
    */

    'async' => env('BEACON_ASYNC', true),

    /*
    |--------------------------------------------------------------------------
    | Retries
    |--------------------------------------------------------------------------
    |
    | Number of times to retry a failed API call before giving up.
    |
    */

    'retries' => env('BEACON_RETRIES', 3),

];

Features

Built for Laravel developers

Facade + helper function

Use Beacon::method() or the beacon() helper — your call.

Queue-friendly

Async by default. API calls are dispatched to your queue.

Automatic retries

Transient failures are retried with exponential backoff.

Laravel-native config

Publish, customize, and environment-switch as usual.

Supports Laravel 10-13

Tested across all current LTS and active releases.

Start monitoring your Laravel app

Install the package, add your token, and ship status updates from your codebase.

Also available: Node.js →