ShowUser::authorize()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 7
rs 9.4285
1
<?php
2
3
namespace App\Http\Requests;
4
5
use App\Http\Requests\Traits\ChecksPermissions;
6
use Illuminate\Foundation\Http\FormRequest;
7
8
class ShowUser extends FormRequest
9
{
10
    use ChecksPermissions;
11
12
    /**
13
     * Determine if the user is authorized to make this request.
14
     *
15
     * @return bool
16
     */
17
    public function authorize()
18
    {
19
        if ($this->hasPermissionTo('show-users')) {
20
            return true;
21
        }
22
23
        return false;
24
    }
25
26
    /**
27
     * Get the validation rules that apply to the request.
28
     *
29
     * @return array
30
     */
31
    public function rules()
32
    {
33
        return [
34
            //
35
        ];
36
    }
37
}
38