42 lines
1.0 KiB
PHP
42 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Request\Admin;
|
|
|
|
use Hyperf\Validation\Request\FormRequest;
|
|
|
|
class DepotRequest 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_id' => 'sometimes|integer',
|
|
'query_kitchen_id' => 'sometimes|integer',
|
|
'name' => 'required|string',
|
|
'city_id' => 'required|integer|exists:system_city,id',
|
|
'kitchen_id' => 'required|integer|exists:kitchen,id',
|
|
'id' => 'required|integer',
|
|
];
|
|
}
|
|
|
|
protected array $scenes = [
|
|
'depot_list' => ['limit','query_id','query_kitchen_id'],
|
|
'depot_add' => ['name','city_id','kitchen_id'],
|
|
'depot_edit' => ['id','name','city_id','kitchen_id'],
|
|
'depot_delete' => ['id'],
|
|
];
|
|
}
|