Files
hyperf_service/app/Request/Admin/MaterialCategoryRequest.php
LAPTOP-7SGDREK0\shiweijun d231f343d3 fix:depot materialCategory
2025-01-22 17:15:50 +08:00

42 lines
1.0 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Request\Admin;
use Hyperf\Validation\Request\FormRequest;
class MaterialCategoryRequest 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 [
'query_id' =>'required|integer|exists:material_category,id',
'id' =>'required|integer',
'name' =>'required|string',
'parent_id' =>'sometimes|integer|exists:material_category,id',
'city_id' =>'required|integer|exists:system_city,id',
'kitchen_id' =>'required|integer|exists:kitchen,id',
];
}
protected array $scenes = [
'material_category_info' => ['query_id'],
'add' => ['name', 'parent_id', 'city_id', 'kitchen_id'],
'edit' => ['id','name', 'parent_id'],
'delete' => ['id'],
];
}