Files
panel-pelican-dev/app/Console/Commands/Overrides/KeyGenerateCommand.php

29 lines
859 B
PHP
Raw Normal View History

<?php
2024-03-12 22:39:16 -04:00
namespace App\Console\Commands\Overrides;
use Illuminate\Foundation\Console\KeyGenerateCommand as BaseKeyGenerateCommand;
class KeyGenerateCommand extends BaseKeyGenerateCommand
{
/**
* Override the default Laravel key generation command to throw a warning to the user
* if it appears that they have already generated an application encryption key.
*/
2024-03-19 21:12:27 -04:00
public function handle(): void
{
2021-01-23 12:33:34 -08:00
if (!empty(config('app.key')) && $this->input->isInteractive()) {
$this->output->warning(trans('commands.key_generate.error_already_exist'));
if (!$this->confirm(trans('commands.key_generate.understand'))) {
return;
}
if (!$this->confirm(trans('commands.key_generate.continue'))) {
return;
}
}
parent::handle();
}
}