Horizon
class Horizon
Constants
| protected CSP_NONCE_CONTEXT_KEY |
The context key for Horizon's CSP nonce attribute. |
Properties
| static Closure|null | $authUsing | The callback that should be used to authenticate Horizon users. |
|
| static string|null | $slackWebhookUrl | The Slack notifications webhook URL. |
|
| static string|null | $slackChannel | The Slack notifications channel. |
|
| static string|null | $smsNumber | The SMS notifications phone number. |
|
| static string|null | The email address for notifications. |
||
| static array | $databases | The database configuration methods. |
Methods
Configure the Redis databases that will store Horizon data.
Get the CSS for the Horizon dashboard.
Get the JS for the Horizon dashboard.
Get the default JavaScript variables for Horizon.
Specify the email address to which email notifications should be routed.
Specify the webhook URL and channel to which Slack notifications should be routed.
Specify the phone number to which SMS notifications should be routed.
Register the Horizon development commands.
Flush all static state.
Details
at line 60
static bool
check(Request|null $request)
Determine if the given request can access the Horizon dashboard.
at line 74
static Horizon
auth(Closure $callback)
Set the callback that should be used to authenticate Horizon users.
Boot-only. The callback persists in a static property for the worker lifetime and runs on every Horizon dashboard request across all coroutines.
at line 89
static void
use(string $connection)
Configure the Redis databases that will store Horizon data.
Boot-only. Mutates process-global config (database.redis.horizon); per-request use races across coroutines.
at line 117
static HtmlString
css()
Get the CSS for the Horizon dashboard.
at line 143
static HtmlString
js()
Get the JS for the Horizon dashboard.
at line 166
static array
scriptVariables()
Get the default JavaScript variables for Horizon.
at line 180
static Horizon
routeMailNotificationsTo(string $email)
Specify the email address to which email notifications should be routed.
Boot-only. The address persists in a static property for the worker lifetime and is used by every Horizon notification dispatch.
at line 193
static Horizon
routeSlackNotificationsTo(string $url, string|null $channel = null)
Specify the webhook URL and channel to which Slack notifications should be routed.
Boot-only. The URL and channel persist in static properties for the worker lifetime and are used by every Horizon notification dispatch.
at line 207
static Horizon
routeSmsNotificationsTo(string $number)
Specify the phone number to which SMS notifications should be routed.
Boot-only. The number persists in a static property for the worker lifetime and is used by every Horizon notification dispatch.
at line 220
static Horizon
cspNonce(string $nonce)
Set the CSP nonce to use for style and script tags.
Call this from request middleware so the nonce is isolated to the current request coroutine.
at line 236
static void
registerDevCommands()
Register the Horizon development commands.
Boot-only. The registrations persist for the worker lifetime and affect every subsequent development command invocation.
at line 245
static void
flushState()
Flush all static state.