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

UsersMigrationRequest::rules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 7
rs 9.4285
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 UsersMigrationRequest.
10
 *
11
 * @package Acacha\Users\Http\Requests
12
 */
13
class UsersMigrationRequest 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('migrate-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
            'users.*.id' => 'sometimes|numeric',
34
            'filter' => 'sometimes|in:foo,bar'
35
        ];
36
    }
37
}
38