private function saveGameStat(array $stat)
 {
     $validator = Validator::make($stat, StatRequest::getRules());
     if (!$validator->fails()) {
         $statElem = Stat::where('game_id', $stat['game_id'])->where('player_id', $stat['player_id'])->whereNotNull($stat['parameter'])->first();
         $data = ['game_id' => $stat['game_id'], 'player_id' => $stat['player_id'], $stat['parameter'] => $stat['value']];
         if ($statElem) {
             $statElem->update($data);
         } else {
             Stat::create($data);
         }
     }
 }
 public function update(Stat $stat, StatRequest $request)
 {
     $stat->update(['game_id' => $request->get('game_id'), 'player_id' => $request->get('player_id'), $request->get('parameter') => $request->get('value')]);
     Flash::success(trans('general.updated_msg'));
     return redirect(route('admin.stats'));
 }