Completed
Push — master ( db6658...fecd46 )
by Eric
01:44
created

StoreUser::rules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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