/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($num_empleado) { $employe = Employe::where('num_empleado', $num_empleado)->first(); $deparments = Deparment::all()->lists('deparment', 'id')->toArray(); asort($deparments); return view('employees.edit')->with('employe', $employe)->with('deparments', $deparments); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($code) { $deparment = Deparment::where('code', $code)->first(); $deparment->delete(); Flash::error('Departamento borrado con exito!'); return redirect()->route('deparments.index'); }