Commit 973fd138 authored by Josh Brown's avatar Josh Brown

Define the warning callback on the SetAppKey method as getLaravel() doesn't...

Define the warning callback on the SetAppKey method as getLaravel() doesn't exist - Fixes issue #432
parent 51c73b9b
...@@ -4,12 +4,24 @@ namespace Modules\Core\Console\Installers\Scripts; ...@@ -4,12 +4,24 @@ namespace Modules\Core\Console\Installers\Scripts;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use Illuminate\Console\ConfirmableTrait; use Illuminate\Console\ConfirmableTrait;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Encryption\Encrypter; use Illuminate\Encryption\Encrypter;
use Modules\Core\Console\Installers\SetupScript; use Modules\Core\Console\Installers\SetupScript;
class SetAppKey implements SetupScript class SetAppKey implements SetupScript
{ {
use ConfirmableTrait; use ConfirmableTrait;
/**
* @var Application
*/
private $application;
public function __construct(Application $application)
{
$this->application = $application;
}
/** /**
* Fire the install script * Fire the install script
* @param Command $command * @param Command $command
...@@ -90,4 +102,16 @@ class SetAppKey implements SetupScript ...@@ -90,4 +102,16 @@ class SetAppKey implements SetupScript
return "/^APP_KEY{$escaped}/m"; return "/^APP_KEY{$escaped}/m";
} }
/**
* Get the default confirmation callback.
*
* @return \Closure
*/
protected function getDefaultConfirmCallback(): callable
{
return function () {
return $this->application->environment() === 'production';
};
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment