Configuration - Laravel

3 min read Updated: 11.09.2026

Where the configuration lives

Everything sits in config/ray.php, and every value has an .env counterpart.

KeyDefaultMeaning
token, private_key-project credentials; without both the package stays silent
urlhttps://dockray.ioDockRay instance
environmentAPP_ENVenvironment column in the panel
releasenullversion of the deployed application
sample_rate1share of error events sent
traces_sample_rate0share of transactions sent; 0 disables tracing
send_default_usertrueattaches the authenticated user's id, e-mail and name
send_default_piifalseattaches the IP address and user agent
ignore_exceptions[]exception classes never reported
ignore_transactionshorizon*, telescope*, _debugbar*paths never measured, patterns as in Request::is()
options.max_request_body_sizemediumnone, small, medium or always
options.attach_stacktracefalsea stack on plain messages as well

Environments

Every environment should report under an unambiguous name - production, staging, preview. The name is a column in the panel and a filter on the error list, so without it a production outage looks exactly like an error someone triggered in a test. Leave your local environment without credentials: with no token and no key the integration loads and stays silent, so you do not need a separate switch to turn it off.

What to keep out of reporting

ignore_exceptions works on top of Laravel's own dontReport list, so ValidationException, AuthenticationException and HttpException are skipped with no configuration at all. Add the exceptions that are a normal outcome in your application rather than a failure:

php
'ignore_exceptions' => [
    \App\Exceptions\PaymentDeclinedException::class,
    \Illuminate\Session\TokenMismatchException::class,
],

The rule is single: DockRay gets what someone is meant to act on. An expected declined payment or an expired form token is part of normal operation and only eats into the monthly quota.

Transaction naming

Transactions are named after the route pattern - GET /orders/{order}, not GET /orders/8123. That keeps one route as one row in the panel no matter how many identifiers pass through it. If you see thousands of separate transactions, it almost always means the route is defined without a parameter.

User context

The middleware attaches the authenticated user's id, e-mail address and name. Turn it off with RAY_SEND_DEFAULT_USER=false, or replace it with your own set of fields:

php
Ray::setUser(['id' => $account->id, 'username' => $account->slug]);

The IP address and user agent are attached only when RAY_SEND_DEFAULT_PII=true. That is a separate decision from user identity, because it also covers guests.

Reporting by hand

php
use Dock\Ray\Laravel\Ray;
use Dock\Ray\Severity;

Ray::message('Nightly import finished late', Severity::warning());

Queues and Artisan commands

Both run outside the HTTP middleware stack, so they report errors but produce no transactions. The hub is a singleton for the whole process: a long-running queue worker keeps one client and one connection rather than building one per job.

Protecting the private key

The private key is a project secret, not an identifier. Keep it in environment variables, in a secrets manager or in the server configuration - never in the repository, in logs, in a screenshot or in code sent to the browser. One project can hold many keys, so production and staging should each get their own: either can be revoked on its own without interrupting the others. A suspicion that a key leaked is reason enough to revoke it and generate a new one.

Next Verification and common problems - Laravel
Chat with us The chat is closed right now Available: Mo–Fr 08:00–18:00