Total Complexity | 5 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class StoreRoleRequest extends FormRequest |
||
8 | { |
||
9 | /** |
||
10 | * Determine if the user is authorized to make this request. |
||
11 | * |
||
12 | * @return bool |
||
13 | */ |
||
14 | public function authorize() |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * Get the validation rules that apply to the request. |
||
28 | * |
||
29 | * @return array |
||
30 | */ |
||
31 | public function rules() |
||
32 | { |
||
33 | return [ |
||
34 | 'name' => 'required|unique:'.config('roles.rolesTable').',name,'.$this->id.',id', |
||
35 | 'slug' => 'required|unique:'.config('roles.rolesTable').',slug,'.$this->id.',id', |
||
36 | 'description' => 'nullable|string|max:255', |
||
37 | 'level' => 'required|integer', |
||
38 | ]; |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * Return the fields and values to create a new role. |
||
43 | * |
||
44 | * @return array |
||
45 | */ |
||
46 | public function roleFillData() |
||
53 | ]; |
||
54 | } |
||
56 |