/** * Loads the ticket creation page. * * @param unsigned integer $id * @return string */ public function create($id) { $server_check_result = ServerCheckResult::find($id); $server = Server::find($server_check_result->server->id); $service = $server->service(); $client = $service->client; return view('ticket.create', ['client' => $client, 'service' => $service, 'server' => $server, 'server_check_result' => $server_check_result, 'ticket_categories' => TicketCategory::lists('name', 'id'), 'ticket_priorities' => TicketPriority::lists('name', 'id'), 'ticket_priority' => $server_check_result->checkResult->alert->id === 'R' ? 2 : 3, 'ticket_types' => TicketType::lists('name', 'id'), 'reference' => $server->id . $server_check_result->check_result_id . date('YmdHis', strtotime($server_check_result->raised_at))]); }
/** * Loads the server status page. * * @param unsigned integer $id * @return string */ public function server($id = NULL) { if (is_null($id)) { return redirect('status'); } $server = Server::find($id); $service = $server->service(); $client = $service->client; $checks = $server->latestServerCheckResults(); $check_categories = CheckCategory::all(); return view('status.server', compact('client', 'service', 'server', 'checks', 'check_categories')); }