53 lines
1.2 KiB
PHP
53 lines
1.2 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',
|
|
];
|
|
}
|
|
|
|
protected array $scenes = [
|
|
'chef_list' => [
|
|
'limit',
|
|
'query_chef_name',
|
|
'query_chef_id'
|
|
],
|
|
'chef_detail_list' => [
|
|
'chef_id',
|
|
],
|
|
'setting_chef' => [
|
|
'user_id',
|
|
'profile',
|
|
'specialties'
|
|
],
|
|
// 'delete' => ['id'],
|
|
|
|
];
|
|
}
|