-
-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathStatusPageController.php
More file actions
50 lines (44 loc) · 1.24 KB
/
StatusPageController.php
File metadata and controls
50 lines (44 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
namespace Cachet\Http\Controllers\StatusPage;
use Cachet\Enums\ResourceOrderColumnEnum;
use Cachet\Models\Component;
use Cachet\Models\ComponentGroup;
use Cachet\Models\Incident;
use Cachet\Models\Schedule;
use Cachet\Settings\AppSettings;
use Filament\Resources\Resource;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\DB;
use Illuminate\View\View;
class StatusPageController
{
/**
* Create a new controller instance.
*/
public function __construct(protected AppSettings $appSettings)
{
//
}
/**
* Show the status page.
*/
public function index(): View
{
return view('cachet::status-page.index', [
'schedules' => Schedule::query()->with('updates')->incomplete()->orderBy('scheduled_at')->get(),
'display_graphs' => $this->appSettings->display_graphs,
]);
}
/**
* Show the details of a particular incident.
*/
public function show(Incident $incident): View
{
return view('cachet::status-page.incident', [
'incident' => $incident->loadMissing([
'components',
'updates' => fn ($query) => $query->orderByDesc('created_at'),
]),
]);
}
}