public static function insertNewHistory($newhistory, $user_id) { foreach ($newhistory as $row) { $newrow = array('game_id' => $row['game_id'], 'user_id' => $user_id, 'positionid' => $row['positionid'], 'letter' => $row['letter']); \App\Models\GameHistory::create($newrow); } }
/** * Store a newly created resource in storage. * * @param Request $request * @return Response */ public function store(Request $request) { \App\Models\GameHistory::create(\Input::all()); }
/** * @param Request $request * @return Response */ public function history(Request $request) { return view('lots.history', ['history' => GameHistory::with('user', 'game', 'game.lot')->take(10)->get()]); }
public function InsertHistory(Request $request) { $history = $request->history; GameHistory::insertNewHistory($history, \Auth::User()->id); }