| Total Complexity | 5 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class UpdateUser extends FormRequest |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * Determine if the user is authorized to make this request. |
||
| 18 | * |
||
| 19 | * @return bool |
||
| 20 | */ |
||
| 21 | public function authorize() |
||
| 22 | { |
||
| 23 | return !empty(config('rbac.routesMainPermission')) ? $this->user()->can(config('rbac.routesMainPermission')) : true; |
||
| 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 | 'roles' => 'required|array', |
||
| 35 | ]; |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Get the error messages for the defined validation rules. |
||
| 40 | * |
||
| 41 | * @return array |
||
| 42 | */ |
||
| 43 | public function messages() |
||
| 47 | ]; |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Get custom attributes for validator errors. |
||
| 52 | * |
||
| 53 | * @return array |
||
| 54 | */ |
||
| 55 | public function attributes() |
||
| 59 | ]; |
||
| 60 | } |
||
| 62 |