# Laravel

`talaria/laravel` **3.0.3** is the Laravel **10 / 11 / 12** adapter. PHP **8.1+**.

## Install

```bash
composer require talaria/laravel:^3.0
```

## Initialise

```env
TALARIA_API_KEY=tal_sk_prod_nz1_…
TALARIA_BROWSER_API_KEY=tal_pk_prod_nz1_…
TALARIA_RELEASE=1.4.2
```

Do **not** call `Talaria::init()` yourself. The service provider initialises the client. A missing or malformed key never breaks the app: the client is disabled and one warning goes to the Laravel log.

Leave `TALARIA_URL` empty on Talaria Cloud. `TALARIA_RELEASE` is optional; in GitHub Actions or GitLab the SDK sends `<ref>@<shortsha>` when it is unset.

HTML responses on the `web` middleware group load `@newtalaria/browser` from jsDelivr. The default script version is **0.6.0** (`TALARIA_BROWSER_SDK_VERSION`). The current published browser SDK is **0.6.1**; set the env var if you want that pin. Replay, heatmaps, and web vitals start only when the project allows them. Set `TALARIA_BROWSER=false` to skip the script. The injected key is `TALARIA_BROWSER_API_KEY` and must be a `tal_pk_` key. The server `tal_sk_` key is not injected.

## Verify

```php
\Talaria\Talaria::captureException(new \RuntimeException('Talaria test error'));
```

Run this once, then open **Issues** in the [dashboard](https://one.newtalaria.com). The test error shows as a new issue in the key's environment. Nothing there? See [fail-safe](https://docs.newtalaria.com/get-started/fail-safe.md).

## Next

See [configuration](https://docs.newtalaria.com/sdk/laravel/configuration.md), [errors](https://docs.newtalaria.com/sdk/laravel/errors.md), and [tracing](https://docs.newtalaria.com/sdk/laravel/tracing.md). For SiteHost logs, see the [SiteHost guide](https://docs.newtalaria.com/guides/collectors/sitehost.md).
