I developed a laravel API and installed laravel telescope. I want to restrict telescope on prod server, but I don't know how to do it. Solution I found is with Gate, but not working. So my idea is how to restrict route only to specific people (1 or 2). Now all users have access to /telescope.
Gate::define('viewTelescope', function ($user) {
return in_array($user->email, [
//emails
]);
});
Most probably you must have set the environment to local in the .env file of the server.
so just change APP_ENV=production in your server .env file
hope this helps for anyone looking for the answer.