Total Complexity | 3 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class CustomerEquipmentRequest extends FormRequest |
||
9 | { |
||
10 | /** |
||
11 | * Determine if the user is authorized to make this request |
||
12 | */ |
||
13 | public function authorize() |
||
14 | { |
||
15 | 5 | if($this->route('equipment')) |
|
16 | { |
||
17 | 5 | return $this->user()->can('update', CustomerEquipment::find($this->route('equipment'))); |
|
18 | } |
||
19 | 2 | ||
20 | return $this->user()->can('create', CustomerEquipment::class); |
||
21 | } |
||
22 | 3 | ||
23 | /** |
||
24 | * Get the validation rules that apply to the request |
||
25 | */ |
||
26 | public function rules() |
||
33 | 4 | ]; |
|
34 | } |
||
36 |