From e226249f9503e7fcb8c1115767148c8bebfa1da2 Mon Sep 17 00:00:00 2001
From: holyfabi <fabian.holy@cybex-online.com>
Date: Tue, 13 Feb 2024 12:04:33 +0100
Subject: [PATCH] Allow receiving remote dumps on a production system. (#76)

---
 Tests/RemoteDumpTest.php | 15 ---------------
 src/Protector.php        |  4 ----
 2 files changed, 19 deletions(-)

diff --git a/Tests/RemoteDumpTest.php b/Tests/RemoteDumpTest.php
index c612b60..360d76a 100644
--- a/Tests/RemoteDumpTest.php
+++ b/Tests/RemoteDumpTest.php
@@ -85,21 +85,6 @@ public function failOnMissingServerUrl()
         $this->protector->getRemoteDump();
     }
 
-    /**
-     * @test
-     */
-    public function failOnProductionEnvironment()
-    {
-        $this->app->detectEnvironment(fn() => 'production');
-
-        Http::fake([
-            $this->serverUrl => Http::response(),
-        ]);
-
-        $this->expectException(InvalidEnvironmentException::class);
-        $this->protector->getRemoteDump();
-    }
-
     /**
      * @test
      */
diff --git a/src/Protector.php b/src/Protector.php
index d568a23..6b8667f 100644
--- a/src/Protector.php
+++ b/src/Protector.php
@@ -218,10 +218,6 @@ public function getRemoteDump(): string
     {
         $disk = $this->getDisk();
 
-        if (App::environment('production')) {
-            throw new InvalidEnvironmentException('Retrieving a dump is not allowed on production systems.');
-        }
-
         if ($this->shouldEncrypt() && !$this->getPrivateKey()) {
             throw new InvalidConfigurationException(
                 'For using Laravel Sanctum a crypto keypair is required. There was none found in your .env file.'