Request   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A withValidator() 0 4 2
A authorize() 0 3 1
1
<?php
2
3
namespace Modules\Core\Http\Requests;
4
5
use Illuminate\Foundation\Http\FormRequest;
6
use Illuminate\Validation\Validator;
7
8
class Request extends FormRequest
9
{
10
    /**
11
     * Determine if the user is authorized to make this request.
12
     *
13
     * @return bool
14
     */
15
    public function authorize()
16
    {
17
        return true;
18
    }
19
20
    /**
21
     * @param Validator $validator
22
     */
23
    public function withValidator(Validator $validator)
24
    {
25
        if ($validator->fails()) {
26
            abort(422, $validator->errors()->first());
27
        }
28
    }
29
}
30