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

# Debug with Laravel Telescope

> Setting up Laravel Telescope for debugging Laravel


export const VariableBlock = ({name}) => {
  return <var spellCheck={false} title={`Replace '${name}' with your own data`}>{name}</var>;
};

Laravel Telescope complements your local Laravel development environment.
With Telescope, get insight into the requests coming into your app, exceptions, log entries, database queries, queued jobs, mail, notifications, cache operations, scheduled tasks, variable dumps, and more.

To set up Laravel Telescope on your **non-production** environments,
follow these steps.

## 1. Create the APP\_DEBUG variable

To add the `APP_DEBUG` & `TELESCOPE_ENABLED` variables on your project, run the following commands:

```bash Terminal theme={null}
upsun variable:create --level environment --name env:APP_DEBUG --value false
upsun variable:create --level environment --name env:TELESCOPE_ENABLED --value false
```

Note that the default values for your main environment are set to `false`.
To override them on other non-production environments, run the following commands:

```bash Terminal theme={null}
upsun variable:update -e <ENVIRONMENT> --value true env:APP_DEBUG
upsun variable:update -e <ENVIRONMENT> --value true env:TELESCOPE_ENABLED
```

## 2. Add Telescope to your project

1. Run the following Composer command:

   ```bash Terminal theme={null}
   composer require laravel/telescope && php artisan telescope:install
   ```

2. Add the `install` command to your `build` hook in your app configuration,
   so it's run on every deploy.

   ```yaml .upsun/config.yaml theme={null}
   applications:
     myapp:
       [...]
       hooks:
         build: |
           set -eux
           composer --no-ansi --no-interaction install --no-progress --prefer-dist --optimize-autoloader --no-dev
           php artisan telescope:install
   ```

For more options and information on how to manage authentication for the dashboard,
see the [Laravel Telecope documentation](https://laravel.com/docs/master/telescope#installation).

## 3. Deploy the new release

To enable Telescope, push your changes to Upsun:

```bash Terminal theme={null}
git add .
git commit -m "Enable Laravel Horizon"
upsun push
```

You can now access the `/telescope` endpoint of your app.

<img src="https://mintcdn.com/upsun-c9761871/7cK3KMJBgO7MXm_y/images/guides/laravel/telescope-dashboard.png?fit=max&auto=format&n=7cK3KMJBgO7MXm_y&q=85&s=2628ff4bea5d4f1b2c3147dfbe054dcb" alt="Laravel Horizon Dashboard" width="1454" height="1051" data-path="images/guides/laravel/telescope-dashboard.png" />

<Tip>
  Telescope uses a gate defined in `TelescopeServiceProvider.php` to authorize access to the dashboard.
  Check that the logic here matches your needs.
</Tip>
