mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-17 21:49:01 +01:00
22 lines
572 B
PHP
22 lines
572 B
PHP
<?php
|
|
|
|
View::composer('index', function ($view) {
|
|
$date = date('Y-m-d');
|
|
|
|
$incidents = Incident::orderBy('created_at', 'desc')->get();
|
|
$incidentCount = $incidents->count();
|
|
|
|
if ($incidentCount === 0 || ($incidentCount > 1 && (int) $incidents->first()->status === 4)) {
|
|
$status = 'success';
|
|
$message = Lang::get('cachet.service.good');
|
|
} else {
|
|
$status = 'danger';
|
|
$message = Lang::get('cachet.service.bad');
|
|
}
|
|
|
|
$view->with([
|
|
'systemStatus' => $status,
|
|
'systemMessage' => $message,
|
|
]);
|
|
});
|