app/Console/Commands/ApiTokenKeyGenerate.php 1 location
|
@@ 28-41 (lines=14) @@
|
| 25 |
|
* |
| 26 |
|
* @return mixed |
| 27 |
|
*/ |
| 28 |
|
public function handle() |
| 29 |
|
{ |
| 30 |
|
$key = $this->generateRandomKey(); |
| 31 |
|
|
| 32 |
|
if ($this->option('show')) { |
| 33 |
|
return $this->comment($key); |
| 34 |
|
} |
| 35 |
|
|
| 36 |
|
$this->setKeyInEnvironmentFile($key); |
| 37 |
|
|
| 38 |
|
$this->laravel['config']['support.api.token.key'] = $key; |
| 39 |
|
|
| 40 |
|
$this->info("Api token key [$key] set successfully."); |
| 41 |
|
} |
| 42 |
|
|
| 43 |
|
/** |
| 44 |
|
* Generate a random key for the api token. |
app/Console/Commands/GenerateInt2stringCharacters.php 1 location
|
@@ 30-43 (lines=14) @@
|
| 27 |
|
* |
| 28 |
|
* @return mixed |
| 29 |
|
*/ |
| 30 |
|
public function handle() |
| 31 |
|
{ |
| 32 |
|
$characters = $this->generateRandomCharacters($this->option('characters')); |
| 33 |
|
|
| 34 |
|
if ($this->option('show')) { |
| 35 |
|
return $this->comment($characters); |
| 36 |
|
} |
| 37 |
|
|
| 38 |
|
$this->setCharactersInConfigFile($characters); |
| 39 |
|
|
| 40 |
|
$this->laravel['config']['support.int2string_characters'] = $characters; |
| 41 |
|
|
| 42 |
|
$this->info("Characters [$characters] set successfully."); |
| 43 |
|
} |
| 44 |
|
|
| 45 |
|
/** |
| 46 |
|
* Generate random characters. |