mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
generate setup key command
This commit is contained in:
parent
4a68842b62
commit
01ad794bce
45
app/Console/Commands/GenerateSetupKey.php
Normal file
45
app/Console/Commands/GenerateSetupKey.php
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user