/** * Displays the specified computers patches. * * @param int|string $computerId * * @return mixed */ public function index($computerId) { $computer = $this->computer->findOrFail($computerId); $navbar = $this->presenter->navbar($computer); $patches = $this->presenter->table($computer); return view('pages.computers.patches.index', compact('computer', 'navbar', 'patches')); }
/** * Checks the specified computers online status. * * @param int|string $id * * @return \Illuminate\Http\RedirectResponse */ public function check($id) { $computer = $this->computer->findOrFail($id); if ($this->dispatch(new CreateStatus($computer))) { flash()->success('Success!', 'Successfully updated status.'); return redirect()->back(); } flash()->error('Error!', 'There was an issue updating this computers status. Please try again.'); return redirect()->back(); }
/** * Deletes the specified computer. * * @param int|string $id * * @return \Illuminate\Http\RedirectResponse */ public function destroy($id) { $computer = $this->computer->findOrFail($id); if ($computer->delete()) { flash()->success('Success!', 'Successfully deleted computer.'); return redirect()->route('computers.index'); } flash()->error('Error!', 'There was an issue deleting this computer. Please try again.'); return redirect()->route('computers.show', [$id]); }