public function edit(Training $training)
 {
     $team = Team::find(config('mls.team_id'));
     $playerList = PlayerRepository::getListByTeamId($team->id);
     $dayList = Training::getDayOfWeekList();
     $visitList = TrainingVisitRepository::getTrainingVisits($training->id);
     $visitList = $visitList->lists('visit', 'player_id');
     return view('frontend.trainings.edit')->with('training', $training)->with('team', $team)->with('playerList', $playerList)->with('dayList', $dayList)->with('visitList', $visitList)->with('statusVisited', Stat::GAME_VISITED)->with('statusNotVisited', Stat::GAME_NOT_VISITED);
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $this->info('Script start');
     $daytime = Carbon::now();
     $trainingList = Training::where('day_of_week', $daytime->dayOfWeek)->where('time', '<', $daytime->format('H:i:s'))->get();
     if ($trainingList->count() < 1) {
         $this->error('No trainings to reset');
         exit;
     }
     foreach ($trainingList as $training) {
         TrainingVisitRepository::clearVisists($training->id);
     }
     $this->info('Script end');
 }
 public function store(Request $request)
 {
     TrainingVisitRepository::saveQuickVisits($request);
     Flash::success(trans('general.updated_msg'));
     return redirect(route('admin.trainingvisits'));
 }