From 7dd6864e63f1207b76c7613dc201630b51337474 Mon Sep 17 00:00:00 2001 From: Liam Loewen <59744937+LiamLoewen@users.noreply.github.com> Date: Mon, 23 Oct 2023 23:32:26 +0000 Subject: [PATCH] Allow use in production Added another config boolean to allow access in production environments. --- config/prequel.php | 11 +++++++++++ src/Http/Middleware/Authorised.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/config/prequel.php b/config/prequel.php index 2c16f96..70268e1 100644 --- a/config/prequel.php +++ b/config/prequel.php @@ -14,6 +14,17 @@ */ 'enabled' => env('PREQUEL_ENABLED', true), + + /* + |-------------------------------------------------------------------------- + | Prequel Production Master Switch : boolean + |-------------------------------------------------------------------------- + | + | Manually enable Prequel in production. This setting should not be enabled! + | + */ + + 'production_enabled' => env('PREQUEL_PRODUCTION_ENABLED', false), /* diff --git a/src/Http/Middleware/Authorised.php b/src/Http/Middleware/Authorised.php index 193d45b..ec75caa 100644 --- a/src/Http/Middleware/Authorised.php +++ b/src/Http/Middleware/Authorised.php @@ -90,7 +90,7 @@ private function configurationCheck() { return (object)[ "enabled" => - config("prequel.enabled") && config("app.env") !== "production", + config("prequel.enabled") && (config("app.env") !== "production" || config("prequel.production_enabled")), "detailed" => "Prequel has been disabled.", ]; }