/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $rodeos = Rodeos::paginate(10); //print_r($animales); die(); $potreros = Potreros::get()->all(); $users = User::get()->all(); return view('rodeos.index', ['rodeos' => $rodeos, 'potreros' => $potreros, 'users' => $users]); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function today() { $bajas = \DB::table('bajas')->select('id', 'fecha', 'rodeo_id', 'animal_id', 'motivo')->where('fecha', '=', date('Y-m-d'))->get(); $potreros = Potreros::get()->all(); $rodeos = Rodeos::get()->all(); $caravanas = Animales::get()->all(); return view('bajas.today', ['bajas' => $bajas, 'potreros' => $potreros, 'rodeos' => $rodeos, 'caravanas' => $caravanas]); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { Potreros::destroy($id); return redirect()->route('potreros.index'); }
public function today() { $animales = \DB::table('animales')->select('id', 'caravana', 'potrero_id', 'raza', 'peso_nacimiento', 'fecha_nacimiento', 'sexo', 'estado')->where('fecha_nacimiento', '=', date('Y-m-d'))->get(); $potreros = Potreros::get()->all(); return view('animales.today', ['animales' => $animales, 'potreros' => $potreros]); }