46 lines
973 B
PHP
46 lines
973 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Request\Admin;
|
|
|
|
use Hyperf\Validation\Request\FormRequest;
|
|
|
|
class DriverRequest 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 [
|
|
'query_driver_name' =>'sometimes|string',
|
|
'query_driver_city_id' => 'sometimes|integer|exists:system_city,id',
|
|
'query_driver_id' =>'sometimes|integer|exists:admin_user,id',
|
|
'limit' => 'required|integer',
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
protected array $scenes = [
|
|
'driver_list' => [
|
|
'limit',
|
|
'query_driver_name',
|
|
'query_driver_city_id',
|
|
'query_driver_id'
|
|
]
|
|
];
|
|
}
|