Fixed generating APP KEY with 'composer update'

This commit is contained in:
Julian Prieber 2022-06-14 23:45:11 +02:00
parent 105e3e21ce
commit d9ccad6c7e
2 changed files with 6 additions and 5 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "khashayarzavosh/littlelink-admin", "name": "julianprieber/littlelink-custom",
"type": "project", "type": "project",
"description": "Littlelink admin is an admin panel for littlelink", "description": "LittleLink Custom is a highly customizable link sharing platform",
"keywords": ["link"], "keywords": ["link"],
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"require": { "require": {
@ -44,9 +44,7 @@
"post-root-package-install": [ "post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
], ],
"post-create-project-cmd": [ "post-update-cmd": ["echo.> storage/app/ISINSTALLED"]
"@php artisan key:generate --ansi"
]
}, },
"extra": { "extra": {
"laravel": { "laravel": {

View File

@ -17,11 +17,14 @@ use App\Http\Controllers\UserController;
| |
*/ */
// Prevents section below from being run by 'composer update'
if(file_exists(base_path('storage/app/ISINSTALLED'))){
// generates new APP KEY if no one is set // generates new APP KEY if no one is set
if(EnvEditor::getKey('APP_KEY')==''){Artisan::call('key:generate');} if(EnvEditor::getKey('APP_KEY')==''){Artisan::call('key:generate');}
// copies template meta config if none is present // copies template meta config if none is present
if(!file_exists(base_path("config/advanced-config.php"))){copy(base_path('storage/templates/advanced-config.php'), base_path('config/advanced-config.php'));} if(!file_exists(base_path("config/advanced-config.php"))){copy(base_path('storage/templates/advanced-config.php'), base_path('config/advanced-config.php'));}
}
//Changes the homepage to a LittleLink Custom profile if set in the config //Changes the homepage to a LittleLink Custom profile if set in the config
if(config('advanced-config.custom_home_url') != '') { if(config('advanced-config.custom_home_url') != '') {