Passed
Pull Request — master (#53)
by
unknown
05:24
created

ScoreSheetController::index()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 14
nc 1
nop 1
dl 0
loc 20
ccs 0
cts 16
cp 0
crap 2
rs 9.7998
c 1
b 0
f 0
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use App\Tournament;
6
7
class ScoreSheetController extends Controller
8
{
9
    /**
10
     * @param $tournamentSlug
11
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
12
     */
13
    public function index($tournamentSlug)
14
    {
15
        $tournament = Tournament::with(
16
            'championships.category',
17
//            'championships.teams',
18
//            'championships.competitors',
19
            'championships.settings',
20
            'championships.fightersGroups.championship.category', // TODO This is not good
21
            'championships.fightersGroups.teams',
22
            'championships.fightersGroups.competitors',
23
            'championships.fightersGroups.fights.group.championship.category', // TODO This is not good
24
            'championships.fightersGroups.fights.competitor1',
25
            'championships.fightersGroups.fights.competitor2',
26
            'championships.fightersGroups.fights.team1',
27
            'championships.fightersGroups.fights.team2'
28
29
        )->where('slug', $tournamentSlug)->first();
30
31
        $sheet = null;
32
        return view('scoresheets.index', compact('tournament', 'sheet'));
33
    }
34
}
35