Docs / Laravel from Sentry

Docs · By hand

Send Laravel errors to Vinktar with the Sentry SDK

At the end the exceptions your Laravel app already reports arrive in Vinktar, next to product events on the same user id.

Before you start

You need a Laravel app with the Sentry SDK, or one you are about to add it to, and a Vinktar project. This guide was checked on sentry-laravel 4.28.0 with Laravel 13.34 and PHP 8.5.

1. Change the DSN

# was: SENTRY_LARAVEL_DSN=https://abc123@o12345.ingest.sentry.io/451
SENTRY_LARAVEL_DSN=https://vnk_pk_YOUR_KEY@in.vinktar.com/YOUR_PROJECT_ID

The key is the project's public write key and the number is the project id. The finished DSN is on the project's Connect page under Manual, and an agent gets it from get_project_keys. No project yet? Create one free, no card needed. config/sentry.php reads SENTRY_LARAVEL_DSN first and SENTRY_DSN after it. On Laravel 11 and later the Integration::handles line is what reports an unhandled request exception; without it sentry:test and captureMessage work and a route that throws sends nothing.

2. Check it worked

php artisan sentry:test sends one exception. Within a few seconds the project's Errors page lists Exception: This is a test exception sent from the Sentry Laravel SDK.

3. Set the release, environment and user

SENTRY_RELEASE=2026.10.05        # config/sentry.php reads both; the Vinktar SDK below gets the same name
SENTRY_ENVIRONMENT=production
SENTRY_TRACES_SAMPLE_RATE=0      # sentry:publish writes 1.0, a transaction per request that is dropped here

The release and environment are the Sentry SDK's own options and arrive on every error. The user id is what joins an error to a person: without setUser an error from a signed-in request is anonymous. Use the same id you will pass to identify() below.

4. Add product events

The DSN carries errors only. Product events come from vinktarhq/php, which is a beta: the API can still change before 0.2.0. It sends on the same write key, and the same release, environment and user id make the error and the person's events one record.

composer require vinktarhq/php:^0.2@beta

Event names and property keys are snake_case, the object then a past-tense action. Define each one as you add it, with define_event from your agent or in the project's data dictionary, so the name keeps one meaning. Under PHP-FPM what a request queues is sent when the request ends; a queue worker wraps each job in withScope() and calls flush() after it, as the SDK README shows.

What arrives, and what does not

Stored

  • Uncaught exceptions and anything passed to captureException: type, message and the 50 frames nearest the crash. A Laravel request stack is longer than that; the frames above are cut, not the error.
  • captureMessage calls, as an issue of type Message.
  • Release, environment, the user id and email on the scope, tags, breadcrumbs and the request URL and method.
  • Levels fatal, error, warning and info; debug is stored as info.

Accepted and dropped

Transactions, spans, profiles, sessions, cron check-ins, logs, metrics and attachments get a 200 and are discarded, so the SDK reports no failure. There is no tracing or cron product behind the DSN; keep Sentry for those if you use them.

Everything stored goes through the same pipeline as /v1/errors: the same per-error caps, error rate limit and monthly error budget, described on Switch from Sentry and in section 11 of api.md.

Next