1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/app/Console/Commands/GenerateSetupKey.php
2020-12-24 15:40:20 +01:00

46 lines
914 B
PHP

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class GenerateSetupKey extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'ninja:generate-setup-key';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Generate random APP_KEY value';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$randomString = base64_encode(\Illuminate\Support\Str::random(32));
$this->info('Success! Copy the following content into your .env or docker-compose.yml:');
$this->warn('base64:' . $randomString);
}
}