Exemplo n.º 1
0
 public function getDashboard($id)
 {
     Session::put('faucet_id', $id);
     $faucet = (bool) $id ? Faucet::find($id) : Faucet::getNullFoucet();
     $dt_now = new DateTime(date('Y-m-d'));
     $dt_ban = new DateTime(date('Y-m-d', strtotime($faucet->ban_until)));
     $diff = $dt_now->diff($dt_ban, FALSE);
     $faucet->bandays = $diff->invert ? 0 : $diff->d;
     return view('dashboard', ['faucet' => $faucet]);
 }