public function time() { $time = Carbon::now(); $upcomingMatches = Matches::join('clubs as homeclub', 'matches.home_id', '=', 'homeclub.id')->join('clubs as awayclub', 'matches.away_id', '=', 'awayclub.id')->select('matches.*', 'homeclub.club as home', 'awayclub.club as away')->orderBy('date', 'desc')->first(); $correct = $upcomingMatches->date->format('d.m'); return $upcomingMatches->date->format('d.m h:m'); }
public function showMatchDay($mdID) { $spiele = Matches::join('clubs as homeclub', 'matches.home_id', '=', 'homeclub.id')->join('clubs as awayclub', 'matches.away_id', '=', 'awayclub.id')->select('matches.*', 'homeclub.club as home', 'awayclub.club as away')->orderBy('created_at')->get(); $tabelle = Table::join('clubs', 'tables.club_id', '=', 'clubs.id')->select('tables.*', 'clubs.club')->orderBy('tables.points', 'desc')->orderBy(DB::raw('goals - goals_against'), 'desc')->orderBy('tables.goals', 'desc')->get(); return view('pages.spiele', compact('spiele', 'tabelle')); }