22 lines
422 B
PHP
22 lines
422 B
PHP
<?php
|
|
|
|
namespace App\Lib;
|
|
|
|
use Illuminate\Encryption\Encrypter;
|
|
|
|
class Common
|
|
{
|
|
/**
|
|
* Generate a random key for the application.
|
|
*
|
|
* ! Copy from \Illuminate\Foundation\Console\KeyGenerateCommand
|
|
*
|
|
* @return string
|
|
*/
|
|
public static function generateRandomKey()
|
|
{
|
|
return 'base64:' . base64_encode(
|
|
Encrypter::generateKey(config('app.cipher'))
|
|
);
|
|
}
|
|
}
|