Files
hyperf_service/app/Request/Api/DishRequest.php
LAPTOP-7SGDREK0\shiweijun 51710eae96 fix:dish material
2025-02-24 16:52:26 +08:00

42 lines
1013 B
PHP

<?php
declare(strict_types=1);
namespace App\Request\Api;
use Hyperf\Validation\Request\FormRequest;
class DishRequest 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',
'dish_name' => 'sometimes|string',
'date' => 'sometimes',
'city_id' => 'required|integer|exists:system_city,id',
'kitchen_id' => 'required|integer|exists:kitchen,id',
];
}
protected array $scenes = [
'add' => ['dish_name','profile','pre_quantity','price','side_dish','flavor','date','city_id','kitchen_id'],
'edit' => ['id','dish_name','profile','pre_quantity','price','side_dish','flavor'],
'list' =>['limit'],
'delete' =>['id'],
];
}