Completed
Push — master ( 2ff197...58043b )
by Sergi Tur
06:57
created

MassiveDestroyRequest::authorize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Acacha\Users\Http\Requests;
4
5
use Auth;
6
use Illuminate\Foundation\Http\FormRequest;
7
8
/**
9
 * Class MassiveDestroyRequest.
10
 *
11
 * @package Acacha\Users\Http\Requests
12
 */
13
class MassiveDestroyRequest extends FormRequest
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::user()->can('massive-delete-users');
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
            'ids'     => 'required'
34
        ];
35
    }
36
}
37