public static function generateAddress($entity, $project = false) { $id_name = $project ? "project_id" : "user_id"; // now generate their address $count = Pool::whereNull('used')->limit(1)->update([$id_name => $entity->id, 'used' => date('Y-m-d H:i:s', time())]); if ($count == 1) { $address = Pool::where($id_name, $entity->id)->pluck('address')[0]; $entity->ltc_address = $address; $entity->save(); } return isset($address) ? $address : false; }
public function scoreGamePost(Request $request) { $homeScore = $request->input('home_score'); $awayScore = $request->input('away_score'); $gameId = $request->input('game_id'); $quarter = $request->input('quarter'); Log::info($homeScore); Log::info($awayScore); $winningSquare = PoolSquare::where('home_score', '=', $homeScore)->where('away_score', '=', $awayScore)->update(array('status' => PoolSquare::STATUS_WINNER)); Pool::where('id', '=', $gameId)->update(array('fq_winner_id' => $winningSquare['id'])); $pool = Pool::find($gameId); Log::info($pool); Session::flash('info', 'Score Was Saved! -- Car:' . $homeScore . ' | Den: ' . $awayScore); $data = array('quarter' => $quarter, 'pool' => $pool['id']); return view('pool.score-game')->with($data); }