Пример #1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     // number of readings preformed today
     $result = Dp::where('dp_date', '=', date('Y-m-d'))->get();
     $num_rows = count($result);
     //dd($result);
     // latest reading
     $reading = Dp::all()->last();
     return view('home', compact('reading'))->with('num_rows', $num_rows);
 }
Пример #2
0
 public function gauge($gauge, $days = 30)
 {
     $readings = Dp::take($days * 2)->get();
     return view('dp.readings_gauge', compact('readings'))->with('gauge_num', $gauge);
 }