Completed
Push — master ( ad6735...e5e602 )
by ARCANEDEV
05:41
created

CreateRoleRequest::all()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
ccs 0
cts 9
cp 0
rs 9.4285
cc 2
eloc 6
nc 2
nop 0
crap 6
1
<?php namespace Arcanesoft\Auth\Http\Requests\Backend\Roles;
2
3
use Arcanesoft\Auth\Bases\FormRequest;
4
5
/**
6
 * Class     CreateRoleRequest
7
 *
8
 * @package  Arcanesoft\Auth\Http\Requests\Backend\Roles
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class CreateRoleRequest extends FormRequest
12
{
13
    /* ------------------------------------------------------------------------------------------------
14
     |  Main Functions
15
     | ------------------------------------------------------------------------------------------------
16
     */
17
    /**
18
     * Determine if the user is authorized to make this request.
19
     *
20
     * @return bool
21
     */
22
    public function authorize()
23
    {
24
        return true;
25
    }
26
27
    /**
28
     * Get the validation rules that apply to the request.
29
     *
30
     * @return array
31
     */
32
    public function rules()
33
    {
34
        return array_merge(parent::rules(), [
35
            'slug' => 'required|min:3|unique:roles,slug',
36
        ]);
37
    }
38
}
39