public function edit($id)
 {
     $countries = Country::orderBy('name', 'asc')->lists('name', 'id')->all();
     $categories = Category::lists('category', 'category')->all();
     $competition = Competition::whereId($id)->firstOrFail();
     return view('backend.competitions.edit', compact('competition', 'countries', 'categories'));
 }
 public function competition_select($id, $subid)
 {
     $competition = Competition::whereId($id)->first();
     $competitiongroups = Competitiongroup::where('competition_id', '=', $competition->id)->orderBy('date', 'desc')->get();
     if (!$competitiongroups->isEmpty()) {
         $competitiongroup = Competitiongroup::whereId($subid)->firstOrFail();
         $results = Result::where('competitiongroup_id', '=', $competitiongroup->id)->where('dsq_status', 0)->orderBy('total_points', 'desc')->get();
         $results_dsq = Result::where('competitiongroup_id', '=', $competitiongroup->id)->where('dsq_status', 1)->get();
         $teams = Results_team::where('competitiongroup_id', '=', $competitiongroup->id)->orderBy('total_points', 'desc')->get();
     }
     return view('home', compact('competition', 'competitiongroups', 'competitiongroup', 'results', 'results_dsq', 'teams'));
 }