52 lines
1.4 KiB
PHP
52 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Request\Admin;
|
|
|
|
use Hyperf\Validation\Request\FormRequest;
|
|
|
|
class SiteRequest 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|string',
|
|
'city_id' => 'required|integer|exists:system_city,id',
|
|
// 'driver_id' => 'required|integer|exists:admin_user,id',
|
|
// 'kitchen_id' => 'required|integer|exists:kitchen,id',
|
|
'status' => 'required|integer|in:1,2',
|
|
'expected_delivery_time' => 'required|string|date_format:H:i',
|
|
'remark' => 'sometimes|string',
|
|
'address' => 'required|string',
|
|
'lng' => 'required|string',
|
|
'lat' => 'required|string',
|
|
// 'expected_spend_time' => 'required|string|date_format:i:s',
|
|
// 'image_id' => 'sometimes|integer|exists:oss_object,id',
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
public function scenes(): array
|
|
{
|
|
return [
|
|
'add' => ['name', 'city_id', 'driver_id', 'kitchen_id', 'status','expected_delivery_time', 'remark', 'address', 'lng', 'lat','expected_spend_time','image_id'],
|
|
];
|
|
}
|
|
}
|