1 | <?php |
||
2 | |||
3 | namespace App\Http\Controllers; |
||
4 | |||
5 | use App\Grade; |
||
6 | use App\Tournament; |
||
7 | use Illuminate\Http\Request; |
||
8 | |||
9 | class FightController extends Controller |
||
10 | { |
||
11 | /** |
||
12 | * Display a listing of the fights. |
||
13 | * |
||
14 | * @return \Illuminate\Http\Response |
||
15 | */ |
||
16 | public function index(Request $request) |
||
17 | { |
||
18 | $grades = Grade::getAllPlucked(); |
||
19 | $tournament = Tournament::with(['championships.firstRoundFights' => function ($query) { |
||
20 | $query->with(['competitor1.user', 'competitor2.user', 'team1', 'team2']); |
||
21 | }])->where('slug', $request->tournament) |
||
22 | ->first(); |
||
23 | return view('fights.index', compact('tournament', 'grades')); |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
24 | |||
25 | } |
||
26 | } |
||
27 |