From 366ca0e83df7c4fd9c08633f811eb6a792755a19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Fran=C3=A7a?= Date: Mon, 11 Mar 2024 14:00:36 -0300 Subject: [PATCH 1/2] Add verification if telescope is enabled using config helper --- src/Guards/AuthenticationGuard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Guards/AuthenticationGuard.php b/src/Guards/AuthenticationGuard.php index 559e0c7..9da5b59 100644 --- a/src/Guards/AuthenticationGuard.php +++ b/src/Guards/AuthenticationGuard.php @@ -281,7 +281,7 @@ public function user(): ?Authenticatable * @var ?Authenticatable $lastResponse */ // @codeCoverageIgnoreStart - if (class_exists('\Laravel\Telescope\Telescope')) { + if (class_exists('\Laravel\Telescope\Telescope') && config('telescope.enabled') === true) { static $depth = 0; static $lastCalled = null; From a5a0c2897b29a3f8434ea66793ba51b38aacc4a2 Mon Sep 17 00:00:00 2001 From: Evan Sims Date: Mon, 11 Mar 2024 17:31:39 -0500 Subject: [PATCH 2/2] chore: fix linter warning --- src/Guards/AuthenticationGuard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Guards/AuthenticationGuard.php b/src/Guards/AuthenticationGuard.php index 906d588..ceea851 100644 --- a/src/Guards/AuthenticationGuard.php +++ b/src/Guards/AuthenticationGuard.php @@ -283,7 +283,7 @@ public function user(): ?Authenticatable * @var ?Authenticatable $lastResponse */ // @codeCoverageIgnoreStart - if (class_exists('\Laravel\Telescope\Telescope') && config('telescope.enabled') === true) { + if (class_exists('\Laravel\Telescope\Telescope') && true === config('telescope.enabled')) { static $depth = 0; static $lastCalled = null;