Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function schedule($tournamentId) {
- $result1 = Tournament::get();
- $result2 = TournamentSchedule::where('tournament.id', $tournamentId)->get();
- $dataDecode = json_decode($result1);
- foreach($dataDecode[0]->tournaments as $r1) {
- if($r1->id == $tournamentId) {
- $data['end_season'] = $r1->current_season->end_date;
- } else {
- $data['end_season'] = date('Y-m-d',strtotime('-48 hours'));
- }
- }
- $dataDecode = json_decode($result2);
- foreach($dataDecode as $r2) {
- $data['last_update'] = date('d-m-Y H:i:s', strtotime($r2->generated_at));
- $data['tournament'] = $r2->tournament;
- $data['sport_events'] = $r2->sport_events;
- }
- return view('tournament.schedule', $data);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement