mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-07 07:23:58 +09:00
create .env if missing
This commit is contained in:
@@ -18,16 +18,20 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
{
|
{
|
||||||
$alt_bg = '';
|
$alt_bg = '';
|
||||||
|
|
||||||
if(!is_file(database_path(env('DB_DATABASE')))) {
|
if(!is_file(base_path('.env'))) {
|
||||||
|
touch(base_path('.env'));
|
||||||
|
Artisan::call('key:generate');
|
||||||
|
}
|
||||||
|
if(!is_file(database_path('app.sqlite'))) {
|
||||||
// first time setup
|
// first time setup
|
||||||
touch(database_path(env('DB_DATABASE')));
|
touch(database_path('app.sqlite'));
|
||||||
Artisan::call('migrate', array('--path' => 'database/migrations', '--force' => true, '--seed' => true));
|
Artisan::call('migrate', array('--path' => 'database/migrations', '--force' => true, '--seed' => true));
|
||||||
Artisan::call('storage:link');
|
Artisan::call('storage:link');
|
||||||
//Cache
|
//Cache
|
||||||
//Artisan::call('config:cache');
|
//Artisan::call('config:cache');
|
||||||
//Artisan::call('route:cache');
|
//Artisan::call('route:cache');
|
||||||
}
|
}
|
||||||
if(is_file(database_path(env('DB_DATABASE')))) {
|
if(is_file(database_path('app.sqlite'))) {
|
||||||
if(Schema::hasTable('settings')) {
|
if(Schema::hasTable('settings')) {
|
||||||
if($bg_image = Setting::fetch('background_image')) {
|
if($bg_image = Setting::fetch('background_image')) {
|
||||||
$alt_bg = ' style="background-image: url('.asset('storage/'.$bg_image).')"';
|
$alt_bg = ' style="background-image: url('.asset('storage/'.$bg_image).')"';
|
||||||
|
|||||||
Reference in New Issue
Block a user