mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-11-04 02:46:52 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			29 lines
		
	
	
		
			850 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			850 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
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.
 | 
						|
     */
 | 
						|
    public function handle(): void
 | 
						|
    {
 | 
						|
        if (!empty(config('app.key')) && $this->input->isInteractive()) {
 | 
						|
            $this->output->warning(__('commands.key_generate.error_already_exist'));
 | 
						|
            if (!$this->confirm(__('commands.key_generate.understand'))) {
 | 
						|
                return;
 | 
						|
            }
 | 
						|
 | 
						|
            if (!$this->confirm(__('commands.key_generate.continue'))) {
 | 
						|
                return;
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        parent::handle();
 | 
						|
    }
 | 
						|
}
 |