/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $liquidacion = Liquidacion::findOrFail($id); $taxis = Taxi::lists('matricula', 'id'); $choferes = Chofer::lists('apellido', 'id'); return view('liquidaciones.edit', compact('liquidacion'))->with(['taxis' => $taxis, 'choferes' => $choferes]); }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { $chofer = Chofer::findOrFail($id); $chofer->fill($request->all()); $chofer->activo = \Input::has('activo') ? true : false; $chofer->save(); return \Redirect::route('choferes.index'); }
public function listadoChofer(Request $request) { $taxi_id = $request->taxi_id; $chofer_id = $request->chofer_id; $fecha_desde = $request->fecha_desde; $fecha_hasta = $request->fecha_hasta; $chofer = Chofer::where('id', $chofer_id)->first(); $taxi = Taxi::where('id', $taxi_id)->first(); $liquidaciones = Liquidacion::matricula($taxi->id)->choferid($chofer->id)->fechaDesde($fecha_desde)->fechaHasta($fecha_hasta)->orderBy('fecha', 'ASC')->get(); $view = view('liquidaciones.pdf_index', compact('liquidaciones', 'chofer', 'taxi', 'fecha_desde', 'fecha_hasta'))->render(); $pdf = \PDF::loadView('liquidaciones.pdf_index', compact('liquidaciones', 'chofer', 'taxi', 'fecha_desde', 'fecha_hasta')); return $pdf->stream(); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // Find the chofer $chofer = Chofer::find($id); // Delete the model $chofer->forceDelete(); }