From a98150769dc970972c30219662fe0e64259b733f Mon Sep 17 00:00:00 2001 From: Marcial Paul Gargoles Date: Thu, 21 Apr 2022 02:07:08 +0800 Subject: [PATCH] Checking the "viewHorizon" gate first (#1148) Checking the "viewHorizon" gate first before checking if its local environment. --- src/HorizonApplicationServiceProvider.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/HorizonApplicationServiceProvider.php b/src/HorizonApplicationServiceProvider.php index 69a4ed7f..395408e1 100644 --- a/src/HorizonApplicationServiceProvider.php +++ b/src/HorizonApplicationServiceProvider.php @@ -27,8 +27,7 @@ protected function authorization() $this->gate(); Horizon::auth(function ($request) { - return app()->environment('local') || - Gate::check('viewHorizon', [$request->user()]); + return Gate::check('viewHorizon', [$request->user()]) || app()->environment('local'); }); }