ListTask   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 21
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A authorize() 0 4 1
A rules() 0 3 1
1
<?php
2
3
namespace App\Http\Requests;
4
5
use Illuminate\Foundation\Http\FormRequest;
6
use Illuminate\Support\Facades\Auth;
7
8
/**
9
 * Class ListTask.
10
 */
11
class ListTask extends FormRequest
12
{
13
    /**
14
     * Determine if the user is authorized to make this request.
15
     *
16
     * @return bool
17
     */
18
    public function authorize()
19
    {
20
        // Si el usuari té el permis list-tasks -> autoritzat
21
        return Auth::user()->hasPermissionTo('list-tasks');
22
    }
23
24
    /**
25
     * Get the validation rules that apply to the request.
26
     *
27
     * @return array
28
     */
29
    public function rules()
30
    {
31
        return [
32
            //
33
        ];
34
    }
35
}
36