示例#1
0
 /**
  * Remove season.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($season_id)
 {
     Season::destroy($season_id);
     Team::where('season_id', $season_id)->delete();
     Fixture::where('season_id', $season_id)->delete();
     LeagueTable::where('season_id', $season_id)->delete();
     return response()->json(['success' => true]);
 }
示例#2
0
 /**
  * Display a listing of the resource.
  *
  * @param  int  $season_id
  * @return Response
  */
 public function current($season_id)
 {
     $current_fixture = Fixture::where('season_id', $season_id)->whereNotNull('home_team_id')->whereNotNull('away_team_id')->whereNull('home_team_goals')->whereNull('away_team_goals')->with('home_team')->with('away_team')->first();
     return response()->json(['current_fixture' => $current_fixture]);
 }