forked from projects/fipamo
automate environment file creation
added a post install script to the composer.json file to automate the creation of the .env file which hold app specific configs also added a helper function to create new keys in the future
This commit is contained in:
parent
928d5468db
commit
fb3aff6c85
3 changed files with 14 additions and 3 deletions
|
@ -1,5 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Encryption\Encrypter;
|
||||||
|
|
||||||
function createUUID()
|
function createUUID()
|
||||||
{
|
{
|
||||||
if (function_exists('com_create_guid') === true) {
|
if (function_exists('com_create_guid') === true) {
|
||||||
|
@ -56,6 +58,11 @@ function randomString(int $length)
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createAppKey()
|
||||||
|
{
|
||||||
|
return 'base64:' . base64_encode(Encrypter::generateKey(config('app.cipher')));
|
||||||
|
}
|
||||||
|
|
||||||
function delete_directory($dirPath)
|
function delete_directory($dirPath)
|
||||||
{
|
{
|
||||||
if (is_dir($dirPath)) {
|
if (is_dir($dirPath)) {
|
||||||
|
|
|
@ -67,6 +67,10 @@
|
||||||
],
|
],
|
||||||
"start": [
|
"start": [
|
||||||
"@php -S localhost:8000 -t public/"
|
"@php -S localhost:8000 -t public/"
|
||||||
|
],
|
||||||
|
"post-install-cmd": [
|
||||||
|
"php -r \"copy('.env.example', '.env');\"",
|
||||||
|
"php artisan key:generate"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
|
|
Loading…
Reference in a new issue