public function destroy($id) { $retrieval = Retrieval::find($id); $handbook = Handbook::find($retrieval->handbook_id); $handbook->feasible = $handbook->feasible + 1; $handbook->save(); Retrieval::destroy($id); Session::flash('message', 'Pengambilan Handbook telah dibatalkan'); }
public function show($id) { $employee = Employee::findOrFail($id); $registrations = Registration::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where('employee_id', '=', $id)->orderBy('registration_date', 'desc')->get(); $earnings = Earning::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where('employee_id', '=', $id)->get(); $retrievals = Retrieval::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where('employee_id', '=', $id)->get(); $timelines = Timeline::where('project_id', '=', Auth::user()->curr_project_id)->where('location_id', '=', Auth::user()->location_id)->where('informable_type', '=', 'Employee')->where('informable_id', '=', $id)->get(); $menu = 'employee'; return View::make('employees.show', compact('employee', 'registrations', 'earnings', 'retrievals', 'timelines', 'menu')); }