From da5ea23601de4f6b1b6534c6fad4ba560235566e Mon Sep 17 00:00:00 2001 From: Josh Brown Date: Sat, 11 Nov 2017 18:53:23 +0000 Subject: [PATCH] Define the warning callback on the SetAppKey method as getLaravel() doesn't exist - Fixes issue #432 --- .../Console/Installers/Scripts/SetAppKey.php | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Modules/Core/Console/Installers/Scripts/SetAppKey.php b/Modules/Core/Console/Installers/Scripts/SetAppKey.php index 167a933e3..d49f6e080 100644 --- a/Modules/Core/Console/Installers/Scripts/SetAppKey.php +++ b/Modules/Core/Console/Installers/Scripts/SetAppKey.php @@ -4,12 +4,24 @@ use Illuminate\Console\Command; use Illuminate\Console\ConfirmableTrait; +use Illuminate\Contracts\Foundation\Application; use Illuminate\Encryption\Encrypter; use Modules\Core\Console\Installers\SetupScript; class SetAppKey implements SetupScript { use ConfirmableTrait; + + /** + * @var Application + */ + private $application; + + public function __construct(Application $application) + { + $this->application = $application; + } + /** * Fire the install script * @param Command $command @@ -90,4 +102,16 @@ protected function keyReplacementPattern() return "/^APP_KEY{$escaped}/m"; } + + /** + * Get the default confirmation callback. + * + * @return \Closure + */ + protected function getDefaultConfirmCallback(): callable + { + return function () { + return $this->application->environment() === 'production'; + }; + } }