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

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