update(['is_scheduler_running' => true]); if(config('ninja.app_version') != base_path('VERSION.txt')) { try { Artisan::call('migrate', ['--force' => true]); } catch (\Exception $e) { nlog("I wasn't able to migrate the data."); nlog($e->getMessage()); } try { Artisan::call('clear-compiled'); Artisan::call('route:clear'); Artisan::call('config:cache'); } catch (\Exception $e) { nlog("I wasn't able to optimize."); nlog($e->getMessage()); } try { Artisan::call('view:clear'); } catch (\Exception $e) { nlog("I wasn't able to clear the views."); nlog($e->getMessage()); } VersionCheck::dispatch(); } } }