Fixed the status alert
This commit is contained in:
@@ -3,13 +3,10 @@
|
||||
View::composer('index', function ($view) {
|
||||
$date = date('Y-m-d');
|
||||
|
||||
$incidents = Incident::whereRaw('DATE(created_at) = "'.$date.'"')
|
||||
->groupBy('status')
|
||||
->orderBy('status', 'desc');
|
||||
|
||||
$incidents = Incident::orderBy('created_at', 'desc')->get();
|
||||
$incidentCount = $incidents->count();
|
||||
|
||||
if ($incidentCount <= 1 || ($incidentCount > 1 && (int) $incidents->first()->status === 4)) {
|
||||
if ($incidentCount === 0 || ($incidentCount > 1 && (int) $incidents->first()->status === 4)) {
|
||||
$status = 'success';
|
||||
$message = Lang::get('cachet.service.good');
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user