Files
hyperf_service/app/Request/Admin/MaterialCategoryRequest.php
LAPTOP-7SGDREK0\shiweijun 604c6ff799 fix:material_category
2025-02-27 16:55:58 +08:00

43 lines
1.1 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'],
'list' => ['query_city_id'],
];
}