feat : kitchen
This commit is contained in:
50
app/Request/Admin/KitchenRequest.php
Normal file
50
app/Request/Admin/KitchenRequest.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?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'],
|
||||
];
|
||||
}
|
||||
28
app/Request/Admin/SiteRequest.php
Normal file
28
app/Request/Admin/SiteRequest.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?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 [
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user