Files
hyperf_service/app/Request/Admin/ChefRequest.php
2025-01-14 17:36:32 +08:00

56 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Request\Admin;
use Hyperf\Validation\Request\FormRequest;
class ChefRequest 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 [
'limit' => 'required|integer',
'query_chef_name' =>'sometimes|string',
'query_chef_id' =>'sometimes|integer|exists:admin_user,id',
'chef_id' =>'sometimes|integer|exists:admin_user,id',
'user_id' =>'required|integer|exists:chef,user_id',
'profile' =>'sometimes',
'specialties' =>'sometimes',
'query_city_id' => 'sometimes|integer|exists:system_city,id',
];
}
protected array $scenes = [
'chef_list' => [
'limit',
'query_chef_name',
'query_chef_id'
],
'chef_detail_list' => [
'limit',
'query_city_id',
'query_chef_name'
],
'setting_chef' => [
'user_id',
'profile',
'specialties'
],
// 'delete' => ['id'],
];
}