mirror of
https://gitee.com/ctexthuang/hyperf_rbac_framework_server_ctexthuang.git
synced 2025-12-25 14:25:40 +08:00
58 lines
1.3 KiB
PHP
58 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Request\Admin;
|
|
|
|
use Hyperf\Validation\Request\FormRequest;
|
|
|
|
class PermissionRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'nickname' => 'sometimes|string|max:255',
|
|
'new_password' => 'sometimes|confirmed|string|min:8',
|
|
'new_password_confirmation' => 'sometimes|string|min:8',
|
|
'old_password' => ['sometimes', 'string'],
|
|
'avatar' => 'sometimes|string|max:255',
|
|
'signed' => 'sometimes|string|max:255',
|
|
'backend_setting' => 'sometimes|array',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function messages(): array
|
|
{
|
|
return parent::messages();
|
|
}
|
|
|
|
/**
|
|
* @var array|array[]
|
|
*/
|
|
protected array $scenes = [
|
|
'update' => [
|
|
'nickname',
|
|
'new_password',
|
|
'new_password_confirmation',
|
|
'old_password',
|
|
'avatar',
|
|
'signed',
|
|
'backend_setting',
|
|
],
|
|
];
|
|
}
|