feat:dish
This commit is contained in:
40
app/Request/Api/DishRequest.php
Normal file
40
app/Request/Api/DishRequest.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?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',
|
||||
'cycle_id' => 'sometimes|integer|exists:cycle,id',
|
||||
'city_id' => 'sometimes|integer|exists:system_city,id',
|
||||
'kitchen_id' => 'sometimes|integer|exists:kitchen,id',
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
protected array $scenes = [
|
||||
'add' => ['dish_name','profile','pre_quantity','price','side_dish','flavor','cycle_id','city_id','kitchen_id'],
|
||||
'edit' => ['id','dish_name','profile','pre_quantity','price','side_dish','flavor'],
|
||||
'list' =>['limit']
|
||||
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user