public function validateRequestOrFail($request, array $rules, $messages = [], $customAttributes = [])
    {
        $validator = $this->getValidationFactory()->make($request->all(), $rules, $messages, $customAttributes);

        if ($validator->fails()) {
            throw new HttpException(400, json_encode($validator->errors()->getMessages()));
        }
    }
public function validateRequestOrFail($request, array $rules, $messages = [], $customAttributes = [])
    {
        $validator = $this->getValidationFactory()->make($request->all(), $rules, $messages, $customAttributes);

        if ($validator->fails()) {
            throw new HttpException(400, json_encode($validator->errors()->getMessages()));
        }
    }
public function validateRequestOrFail ( $ request , array $ rules , $ messages = [ ] , $ customAttributes = [ ] ) { $ validator = $ this -> getValidationFactory ( ) -> make ( $ request -> all ( ) , $ rules , $ messages , $ customAttributes ) ; if ( $ validator -> fails ( ) ) { throw new HttpException ( 400 , json_encode ( $ validator -> errors ( ) -> getMessages ( ) ) ) ; } }
Validate request for current resource.

@param Request $request
@param array   $rules
@param array   $messages
@param array   $customAttributes
Validate request for current resource .