Move dashboard version check into version api endpoint

This commit is contained in:
James Brooks
2016-06-10 17:27:21 +01:00
parent 1425c15ee8
commit 947aa27e40
5 changed files with 21 additions and 22 deletions
@@ -91,20 +91,4 @@ class ApiController extends Controller
throw new ModelNotFoundException("Incident template for $templateSlug could not be found.");
}
/**
* Checks if Cachet is up to date.
*
* @return \Illuminate\Http\JsonResponse
*/
public function checkVersion()
{
$latest = app(Releases::class)->latest();
return Response::json([
'cachet_version' => CACHET_VERSION,
'latest_version' => $latest,
'is_latest' => version_compare(CACHET_VERSION, $latest) === 1,
]);
}
}