# Installing the Laravel client

Version 4 of `larabug/larabug` needs PHP 8.2 and Laravel 11, 12 or 13.

## Install the package

```bash
composer require "larabug/larabug:^4.0@beta" -W
```

Version 4 is in beta, so it is named: a bare `composer require larabug/larabug` installs the last stable release, 3.8, which is set up differently. `-W` lets Composer settle Guzzle on 7, which this release still needs; a new Laravel 13 application ships with Guzzle 8, and without it the install does not resolve.

## Add your DSN

```env .env
LB_DSN=https://ingest-key:project-key@www.larabug.com/api/log
```

The DSN is on the application's page until the application receives its first event, and on its settings page after that, filled in with the application's own keys. The pair still works, and the DSN wins when both are set:

```env .env
LB_KEY=your-ingest-key
LB_PROJECT_KEY=your-project-key
```

See [applications and keys](/docs/general/projects-and-keys).

## There is nothing to register

The package registers itself with Laravel's exception handler, so there is nothing to add to `bootstrap/app.php` or `config/logging.php`. Adding a `larabug` channel to your log stack, as version 3 asked, sends exceptions down a second path; leave it out.

Publishing the config is optional, and only needed to change a default:

```bash
php artisan vendor:publish --provider="LaraBug\ServiceProvider"
```

That writes `config/larabug.php`. Every option in it is documented under [configuration](/docs/laravel/configuration).

## Check it works

```bash
php artisan larabug:test
```

The command checks the keys and the environment, builds a test exception and sends it. The application's page notices it by itself within a few seconds.

Exceptions are only sent from the environments in `environments`, which is `production` until you change it. To test from your own machine without changing anything, treat that one command as production:

```bash
APP_ENV=production php artisan larabug:test
```

If nothing arrives, [troubleshooting](/docs/laravel/troubleshooting) starts with the four things that cause almost all of it.

![The dashboard in the panel once the first events have arrived](/images/docs/dashboard.png)

## What reports by default

Out of the box, and only in the environments you have listed:

* Every unhandled exception.
* Every failed queue job, and every completed one.
* Known vulnerabilities in `composer.lock`, checked daily.

Nothing else is sent, and nothing is sent at all from an environment that is not on the list. The default list is `production`.

Requests, queries, logs, commands and scheduled tasks are each one switch away. [What LaraBug records](/docs/telemetry/overview) is the list, with what each one costs.