mirror of
https://gitee.com/ctexthuang/hyperf_rbac_framework_server_ctexthuang.git
synced 2025-12-25 17:07:49 +08:00
fix : update path And request
This commit is contained in:
57
app/Request/Admin/PermissionRequest.php
Normal file
57
app/Request/Admin/PermissionRequest.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?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',
|
||||
],
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user