Browse Source

Initial application process

pull/308/head 2.1.0
Kode 6 years ago
parent
commit
0067502b37
  1. 10
      app/Providers/AppServiceProvider.php

10
app/Providers/AppServiceProvider.php

@ -7,6 +7,8 @@ use Artisan;
use Schema; use Schema;
use App\Setting; use App\Setting;
use App\User; use App\User;
use App\Application;
use App\Jobs\ProcessApps;
class AppServiceProvider extends ServiceProvider class AppServiceProvider extends ServiceProvider
{ {
@ -18,7 +20,6 @@ class AppServiceProvider extends ServiceProvider
public function boot() public function boot()
{ {
if(!is_file(base_path('.env'))) { if(!is_file(base_path('.env'))) {
touch(base_path('.env')); touch(base_path('.env'));
Artisan::call('key:generate'); Artisan::call('key:generate');
@ -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 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)); Artisan::call('migrate', array('--path' => 'database/migrations', '--force' => true, '--seed' => true));
} }
} else { } else {
Artisan::call('migrate', array('--path' => 'database/migrations', '--force' => true, '--seed' => true)); 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'))) { if(!is_file(public_path('storage'))) {
Artisan::call('storage:link'); Artisan::call('storage:link');
\Session::put('current_user', null); \Session::put('current_user', null);

Loading…
Cancel
Save