Skip to content

Commit

Permalink
Initial application process
Browse files Browse the repository at this point in the history
  • Loading branch information
KodeStar committed Nov 4, 2018
1 parent d321af6 commit 0067502
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use Schema;
use App\Setting;
use App\User;
use App\Application;
use App\Jobs\ProcessApps;

class AppServiceProvider extends ServiceProvider
{
Expand All @@ -17,7 +19,6 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{


if(!is_file(base_path('.env'))) {
touch(base_path('.env'));
Expand All @@ -40,11 +41,18 @@ public function boot()
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);
Expand Down

0 comments on commit 0067502

Please sign in to comment.