app/Http/Requests/UserIndexRequest.php
/**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
Get the validation rules that apply to the request.
@return array
Get the validation rules that apply to the request . @return array
public function rules()
    {
        return [
            'filter' => 'nullable|array|exists:roles,id',
            'sort_type' => [
                'nullable',
                Rule::in([
                    'staff_code',
                    'full_name',
                    'username',
                    'joined_date',
                    'type',
                ])
            ],
            'sort_value' => ['nullable', Rule::in(['asc', 'desc'])],
            'search' => 'nullable',
            'per_page' => 'nullable|integer',
        ];
    }
public function rules ( ) { return [ 'filter' => 'nullable|array|exists:roles,id' , 'sort_type' => [ 'nullable' , Rule :: in ( [ 'staff_code' , 'full_name' , 'username' , 'joined_date' , 'type' , ] ) ] , 'sort_value' => [ 'nullable' , Rule :: in ( [ 'asc' , 'desc' ] ) ] , 'search' => 'nullable' , 'per_page' => 'nullable|integer' , ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .