From 0067502b376bebd5fe6c2f85a3616fd1e01ff252 Mon Sep 17 00:00:00 2001 From: Kode Date: Sun, 4 Nov 2018 16:20:12 +0000 Subject: [PATCH] Initial application process --- app/Providers/AppServiceProvider.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index c7ae1637..de2f1095 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -7,6 +7,8 @@ use Artisan; use Schema; use App\Setting; use App\User; +use App\Application; +use App\Jobs\ProcessApps; class AppServiceProvider extends ServiceProvider { @@ -17,7 +19,6 @@ class AppServiceProvider extends ServiceProvider */ public function boot() { - if(!is_file(base_path('.env'))) { touch(base_path('.env')); @@ -40,11 +41,18 @@ class AppServiceProvider extends ServiceProvider if(version_compare($app_version, $db_version) == 1) { // app is higher than db, so need to run migrations etc Artisan::call('migrate', array('--path' => 'database/migrations', '--force' => true, '--seed' => true)); } + } else { Artisan::call('migrate', array('--path' => 'database/migrations', '--force' => true, '--seed' => true)); } } + + $applications = Application::all(); + if($applications->count() <= 0) { + ProcessApps::dispatch(); + } + if(!is_file(public_path('storage'))) { Artisan::call('storage:link'); \Session::put('current_user', null);