app/Http/Requests/ReturningIndexRequest.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 [
            'states' => [
                'nullable',
                'array',
            ],
            'states.*' => [
                'string',
                Rule::in(Returning::getAllStates())
            ],
            'date' => [
                'nullable',
                'date'
            ],
            'sort_type' => [
                'nullable',
                Rule::in([
                    'id',
                    'asset_code',
                    'asset_name',
                    'requested_by_username',
                    'accepted_by_username',
                    'assign_date',
                    'returned_date',
                    'state_name',
                ])
            ],
            'sort_value' => ['nullable', Rule::in(['asc', 'desc'])],
            'search' => 'nullable',
            'per_page' => ['nullable', 'integer']
        ];
    }
public function rules ( ) { return [ 'states' => [ 'nullable' , 'array' , ] , 'states.*' => [ 'string' , Rule :: in ( Returning :: getAllStates ( ) ) ] , 'date' => [ 'nullable' , 'date' ] , 'sort_type' => [ 'nullable' , Rule :: in ( [ 'id' , 'asset_code' , 'asset_name' , 'requested_by_username' , 'accepted_by_username' , 'assign_date' , 'returned_date' , 'state_name' , ] ) ] , '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 .