We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| @@ 7-33 (lines=27) @@ | ||
| 4 | ||
| 5 | use Illuminate\Foundation\Http\FormRequest; |
|
| 6 | ||
| 7 | class PermissionStoreCrudRequest extends FormRequest |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Determine if the user is authorized to make this request. |
|
| 11 | * |
|
| 12 | * @return bool |
|
| 13 | */ |
|
| 14 | public function authorize() |
|
| 15 | { |
|
| 16 | // only allow updates if the user is logged in |
|
| 17 | return backpack_auth()->check(); |
|
| 18 | } |
|
| 19 | ||
| 20 | /** |
|
| 21 | * Get the validation rules that apply to the request. |
|
| 22 | * |
|
| 23 | * @return array |
|
| 24 | */ |
|
| 25 | public function rules() |
|
| 26 | { |
|
| 27 | $rules = [ |
|
| 28 | 'name' => 'required|string|max:255|unique:'.config('permission.table_names.permissions', 'permissions').',name', |
|
| 29 | ]; |
|
| 30 | ||
| 31 | return $rules; |
|
| 32 | } |
|
| 33 | } |
|
| 34 | ||
| @@ 7-33 (lines=27) @@ | ||
| 4 | ||
| 5 | use Illuminate\Foundation\Http\FormRequest; |
|
| 6 | ||
| 7 | class RoleStoreCrudRequest extends FormRequest |
|
| 8 | { |
|
| 9 | /** |
|
| 10 | * Determine if the user is authorized to make this request. |
|
| 11 | * |
|
| 12 | * @return bool |
|
| 13 | */ |
|
| 14 | public function authorize() |
|
| 15 | { |
|
| 16 | // only allow updates if the user is logged in |
|
| 17 | return backpack_auth()->check(); |
|
| 18 | } |
|
| 19 | ||
| 20 | /** |
|
| 21 | * Get the validation rules that apply to the request. |
|
| 22 | * |
|
| 23 | * @return array |
|
| 24 | */ |
|
| 25 | public function rules() |
|
| 26 | { |
|
| 27 | $rules = [ |
|
| 28 | 'name' => 'required|string|max:255|unique:'.config('permission.table_names.roles', 'roles').',name', |
|
| 29 | ]; |
|
| 30 | ||
| 31 | return $rules; |
|
| 32 | } |
|
| 33 | } |
|
| 34 | ||