laravel request rule

Solutions on MaxInterview for laravel request rule by the best coders in the world

showing results for - "laravel request rule"
Ryland
17 Jul 2020
1<?php
2
3namespace App\Http\Requests;
4
5use Illuminate\Foundation\Http\FormRequest;
6use Illuminate\Validation\Rule;
7
8class StarShopRequest extends FormRequest
9{
10    /**
11     * Get the validation rules that apply to the request.
12     *
13     * @return array
14     */
15    public function rules()
16    {
17        return [
18            'number' => [
19                'required',
20                Rule::in([1, 11, 20, 35])
21            ]
22        ];
23    }
24
25}