> ## Documentation Index
> Fetch the complete documentation index at: https://kawax.biz/llms.txt
> Use this file to discover all available pages before exploring further.

# Laravel Telescope

> Uitleg over het invoeren van Laravel Telescope. Behandelt de local-only installatie en de configuratie van watchers.

## Wat is Laravel Telescope

[Laravel Telescope](https://github.com/laravel/telescope) is de officiële debugtool die de interne toestand van je Laravel-applicatie inzichtelijk maakt.
Het legt gedetailleerd requests, exceptions, query's, jobs, logs, e-mails, notificaties, cache-operaties, geplande taken en meer vast.

Het is een debugtool **exclusief voor de lokale ontwikkelomgeving**. Gebruik voor productiemonitoring [Laravel Pulse](/nl/pulse) of [Laravel Nightwatch](/nl/blog/nightwatch-introduction).

### Gemonitorde lagen

```mermaid theme={null}
flowchart LR
    A["HTTP-laag<br>Request / Response"] --> T["Telescope-entries opslaan"]
    B["Applicatielaag<br>Events / Logs / Exceptions"] --> T
    C["Datalaag<br>DB Queries / Redis / Cache"] --> T
    D["Asynchrone laag<br>Queue Jobs / Schedule / Notifications"] --> T
    T --> E["Dashboard<br>/telescope"]
```

***

## Installatie

<Steps>
  <Step title="Telescope installeren">
    ```shell theme={null}
    composer require laravel/telescope
    ```
  </Step>

  <Step title="Assets en migraties publiceren">
    ```shell theme={null}
    php artisan telescope:install
    ```
  </Step>

  <Step title="Migraties uitvoeren">
    ```shell theme={null}
    php artisan migrate
    ```
  </Step>
</Steps>

Na de installatie is het dashboard bereikbaar via `/telescope`.

## Local-only installatie (aanbevolen)

<Info>
  Is debuggen tijdens lokale ontwikkeling je hoofddoel, installeer dan met `--dev` en registreer de service provider handmatig, alleen voor de `local`-omgeving.
</Info>

```shell theme={null}
composer require laravel/telescope --dev

php artisan telescope:install
php artisan migrate
```

Verwijder na het uitvoeren van `telescope:install` de registratie van de `TelescopeServiceProvider` uit `bootstrap/providers.php`.
Registreer hem daarna handmatig in de `register`-methode van `App\Providers\AppServiceProvider`.

```php theme={null}
public function register(): void
{
    if ($this->app->environment('local') && class_exists(\Laravel\Telescope\TelescopeServiceProvider::class)) {
        $this->app->register(\Laravel\Telescope\TelescopeServiceProvider::class);
        $this->app->register(TelescopeServiceProvider::class);
    }
}
```

Schakel bovendien auto-discovery uit in `composer.json`.

```json theme={null}
{
  "extra": {
    "laravel": {
      "dont-discover": [
        "laravel/telescope"
      ]
    }
  }
}
```

***

## Beschikbare watchers

Watchers verzamelen telemetrie tijdens requests en commando-uitvoeringen.
Je beheert het inschakelen en configureren in `config/telescope.php`.

<AccordionGroup>
  <Accordion title="Request Watcher">
    Legt requests, headers, sessies en responses vast.\
    Met `size_limit` beperk je de grootte van vastgelegde responses.
  </Accordion>

  <Accordion title="Query Watcher (extra belangrijk)">
    Legt SQL, bindings en uitvoeringstijden vast.\
    Standaard worden query's van meer dan **100 ms** vastgelegd met de tag `slow`, wat erg nuttig is voor het opsporen van performanceknelpunten.

    ```php theme={null}
    Watchers\QueryWatcher::class => [
        'enabled' => env('TELESCOPE_QUERY_WATCHER', true),
        'slow' => 100,
    ],
    ```
  </Accordion>

  <Accordion title="Job Watcher">
    Legt het plaatsen en het uitvoeringsresultaat van queue-jobs vast.
  </Accordion>

  <Accordion title="Exception Watcher">
    Legt gerapporteerde exceptions en stacktraces vast.
  </Accordion>

  <Accordion title="Log Watcher">
    Legt applicatielogs vast.\
    Standaard vanaf `error` en hoger; via de configuratie kun je dit verlagen tot `debug`.
  </Accordion>

  <Accordion title="Command Watcher">
    Legt de argumenten, opties, output en exitcode van Artisan-commando's vast.
  </Accordion>

  <Accordion title="Event Watcher">
    Legt de payload en listener-informatie van gedispatchte events vast (interne Laravel-events uitgezonderd).
  </Accordion>

  <Accordion title="Cache Watcher">
    Legt cache-hits, -misses, -updates en -verwijderingen vast.
  </Accordion>

  <Accordion title="Redis Watcher">
    Legt Redis-commando's vast die vanuit de applicatie zijn uitgevoerd.
  </Accordion>

  <Accordion title="Model Watcher">
    Legt Eloquent-modelevents vast en kan desgewenst ook het aantal hydrations verzamelen.
  </Accordion>

  <Accordion title="Notification Watcher">
    Legt verstuurde notificaties vast.
  </Accordion>

  <Accordion title="Mail Watcher">
    Laat je verstuurde e-mails in de browser previewen en downloaden als `.eml`.
  </Accordion>

  <Accordion title="HTTP Client Watcher">
    Legt uitgaande HTTP-clientrequests vast.
  </Accordion>

  <Accordion title="Gate Watcher">
    Legt de resultaten van autorisatiechecks via Gates / Policies vast.
  </Accordion>

  <Accordion title="Schedule Watcher">
    Legt gepland uitgevoerde commando's en hun output vast.
  </Accordion>

  <Accordion title="View Watcher">
    Legt de naam, het pad, de data en de composers van gerenderde views vast.
  </Accordion>

  <Accordion title="Batch Watcher">
    Legt queue-batchinformatie vast (jobs en verbindingsinformatie).
  </Accordion>

  <Accordion title="Dump Watcher">
    Legt `dump`-output vast zolang het Dump-tabblad van Telescope openstaat.
  </Accordion>
</AccordionGroup>

***

## Samenvatting

| Taak                               | Aanbevolen aanpak                                                |
| ---------------------------------- | ---------------------------------------------------------------- |
| Invoeren                           | `composer require laravel/telescope --dev`                       |
| Betrouwbare afscheiding tot lokaal | Handmatige providerregistratie + `dont-discover`                 |
| DB-performanceonderzoek            | Gebruik de slow-querytag van de Query Watcher (standaard 100 ms) |

## Volgende stappen

<Columns cols={2}>
  <Card title="Laravel Pulse" icon="chart-line" href="/nl/pulse">
    Voer een dashboard in met performancestatistieken van je productieomgeving.
  </Card>

  <Card title="Laravel Nightwatch" icon="moon" href="/nl/blog/nightwatch-introduction">
    Gebruik Nightwatch voor realtime monitoring van je productieomgeving.
  </Card>
</Columns>


## Related topics

- [Praktische technieken voor Laravel Telescope](/nl/blog/telescope-introduction.md)
- [Laravel Pulse](/nl/pulse.md)
- [Introductie tot Laravel Nightwatch](/nl/blog/nightwatch-introduction.md)
- [Versiecompatibiliteit van packages beheren](/nl/advanced/package-versioning.md)
- [部落格](/zh-TW/blog/index.md)
