/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $work_order = WorkOrder::find($id); return view('dashboard.single', compact('work_order')); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $workOrder = WorkOrder::find($id); if (isset($workOrder)) { // Delete image (if any) $this->uploadHandler->removeFile(public_path(config('app.upload_path')), $workOrder->image_filename); $workOrder->delete(); } }