keksAccount/app/Http/Controllers/StatusController.php

37 lines
657 B
PHP

<?php
namespace App\Http\Controllers;
use App\Exceptions\HTTPException;
use TaGeSo\APIResponse\Response;
class StatusController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
//
}
public function check(Response $response) {
$pdo = app('db')->getPdo();
$sth = $pdo->prepare("SELECT * FROM `failed_jobs`");
$sth->execute();
$res = $sth->fetchAll(\PDO::FETCH_ASSOC);
if(count($res) > 0 ){
throw new HTTPException(500, "Failed Jobs");
}
return $response;
}
//
}