feat:supplier
This commit is contained in:
39
app/Request/Admin/SupplierRequest.php
Normal file
39
app/Request/Admin/SupplierRequest.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Request\Admin;
|
||||
|
||||
use Hyperf\Validation\Request\FormRequest;
|
||||
|
||||
class SupplierRequest 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 [
|
||||
'limit' => 'required|integer',
|
||||
'query_name' => 'sometimes|string',
|
||||
'mobile' => 'digits:11',
|
||||
'city_id' => 'required|integer|exists:system_city,id',
|
||||
'kitchen_id' => 'required|integer|exists:kitchen,id',
|
||||
];
|
||||
}
|
||||
|
||||
protected array $scenes = [
|
||||
'list' => ['limit','query_name'],
|
||||
'add' => ['name','mobile','address','city_id','kitchen_id'],
|
||||
'edit' => ['id','name','mobile','address'],
|
||||
'delete' => ['id'],
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user