class Illuminate / Foundation / Console / KeyGenerateCommand

KeyGenerateCommand

Extends

Uses

Properties

protected

$signature string

The name and signature of the console command.

Default: 'key:generate {--show : Display the key instead of modifying files} {--force : Force the operation to run when in production}'
protected

$description string

The console command description.

Default: 'Set the application key'

Methods

public

handle ( ) : void

Execute the console command.

protected

generateRandomKey ( ) : string

Generate a random key for the application.

protected

setKeyInEnvironmentFile ( $key ) : bool

Set the application key in the environment file.

Parameters

  • $key string
protected

writeNewEnvironmentFileWith ( $key ) : bool

Write a new environment file with the given key.

Parameters

  • $key string
protected

keyReplacementPattern ( ) : string

Get a regex pattern that will match env APP_KEY with any random key.