You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
397 B

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class GenerateKey extends Command {
protected $signature = 'key:generate';
protected $description = 'Generate a random key for APP_KEY';
public function handle() {
$key = bin2hex(random_bytes(16));
$this->line('Below is a random string you can use for APP_KEY in the .env file');
$this->info($key);
}
}