Create   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A authorize() 0 4 1
A rules() 0 9 1
1
<?php
2
3
namespace App\Http\Requests\Tournament;
4
5
use App\Http\Requests\Request;
6
use App\Tournament;
7
use Illuminate\Support\Facades\Auth;
8
9
/**
10
 * Class Create
11
 * @package App\Http\Requests\Tournament
12
 */
13
class Create extends Request
14
{
15
    /**
16
     * Determine if the user is authorized to make this request.
17
     *
18
     * @return bool
19
     */
20
    public function authorize()
21
    {
22
        return Auth::check();
23
    }
24
25
    /**
26
     * Get the validation rules that apply to the request.
27
     *
28
     * @return array
29
     */
30
    public function rules()
31
    {
32
        return [
33
            'tournament.name' => 'required|min:3|max:255',
34
            'tournament.description' => 'min:3|max:255',
35
            'tournament.type' => 'in:' . implode(',', Tournament::getAvailableTypes()),
36
            'tournament.membersType' => 'in:' . implode(',', Tournament::getAvailableMembersType())
37
        ];
38
    }
39
}
40