123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- /**
- * @Name
- * @Description
- * @Author 刘学玺
- * @Date 2024/3/20 14:54
- */
- namespace App\Http\Requests\Frontend\Client\Service;
- use App\Http\Requests\Request;
- use Illuminate\Support\Facades\Route;
- use Illuminate\Validation\Rule;
- class OrderRequest extends Request
- {
- /**
- * Get the validation rules that apply to the request.
- *
- * @return array<string, array|string>
- */
- public function rules(): array
- {
- $rules = [
- 'coachId' => ['bail', 'integer'],
- 'projectId' => ['bail', 'integer'],
- 'couponId' => ['bail', 'integer'],
- 'orderId' => ['bail', 'integer'],
- 'payType' => ['bail', 'integer'],
- 'useBalance' => ['bail', 'integer'],
- 'remark' => ['bail', 'string'],
- 'addressId' => ['bail', 'integer'],
- 'carType' => ['bail', 'integer']
- ];
- $actionName = last(explode('@', Route::current()->getActionName()));
- if ($actionName === 'store') {
- }
- if ($actionName === 'index') {
- }
- if ($actionName === 'show') {
- }
- if ($actionName === 'apply') {
- }
- return $rules;
- }
- public function messages(): array
- {
- return [
- '*' => '参数或类型错误!'
- ];
- }
- }
|