51 lines
1.1 KiB
PHP
51 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Request\Admin;
|
|
|
|
use Hyperf\Validation\Request\FormRequest;
|
|
|
|
class KitchenRequest 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 [
|
|
'name' => 'required',
|
|
'city_id' => 'required|integer|exists:system_city,id',
|
|
'status' => 'required|integer|in:1,2',
|
|
'address' => 'required|string',
|
|
'lng' => 'required|string',
|
|
'lat' => 'required|string',
|
|
'id' => 'required|integer',
|
|
'limit' => 'required|integer',
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
|
|
];
|
|
}
|
|
|
|
protected array $scenes = [
|
|
'add' => ['name', 'city_id', 'status', 'address', 'lng', 'lat'],
|
|
'edit' => ['name', 'city_id', 'status', 'address', 'lng', 'lat','id'],
|
|
'del' => ['id'],
|
|
'info' => ['id'],
|
|
'list' => ['limit'],
|
|
];
|
|
}
|