Files
hyperf_service/app/Request/Admin/AuthRequest.php
2024-10-27 23:45:20 +08:00

43 lines
821 B
PHP

<?php
declare(strict_types=1);
namespace App\Request\Admin;
use Hyperf\Validation\Request\FormRequest;
class AuthRequest 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 [
'role_id' => 'required|integer',
'menu_id' => 'required|integer',
];
}
public function messages(): array
{
return [
'role_id.required' => 'id必填',
'menu_id.required' => 'id必填',
];
}
protected array $scenes = [
'role_info' => 'role_id',
'menu_info' => 'menu_id',
];
}