json(['message' => 'Self update not available on this system.'], 403); } /* .git MUST be owned/writable by the webserver user */ $repo = new GitRepository(base_path()); info('Are there changes to pull? '.$repo->hasChanges()); try { $res = $repo->pull(); } catch (GitException $e) { info($e->getMessage()); return response()->json(['message'=>$e->getMessage()], 500); } info('Are there any changes to pull? '.$repo->hasChanges()); Artisan::call('ninja:post-update'); return response()->json(['message' => ''], 200); } }