Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dcabane's avatar

Accessing telescope in production

Hello fellow laravites, I just deployed my application online (using Digital Ocean and Forge) and I would like to be able to access laravel telescope. I updated the gate() method in the TelescopeServiceProvider.php as follows :

protected function gate()
    {
        Gate::define('viewTelescope', function ($user) {
            return $user->id == 1;
        });
    }

Somehow, this does not seem to be working. When I visit my-website-url/telescope, logged in as the user with id 1, I still get a 403 I also tried this :

            return in_array($user->email, [
                 '[email protected]'
            ]);

but the result is the same.

Can anyone spot my mistake ? Thanks in advance !

0 likes
4 replies
Nakov's avatar
Nakov
Best Answer
Level 73

Have you registered your TelescopeServiceProvider in config\app.php providers array?

Snapey's avatar

where does $user come from in your gate function?

Nakov's avatar

@SNAPEY - the first param in the authorization is the authenticated user I believe, and his usage is the same as given in the documentation

dcabane's avatar

Thanks guys for your replies ! I tried Nakov's suggestion and it worked. I thought that service provider was automatically registered, that was my mistake.

Please or to participate in this conversation.