original_string: 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()));
          }
      }
code: 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()));
          }
      }
code_tokens: 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 ( ) ) ) ; } }
docstring: Validate request for current resource.
  
  @param Request $request
  @param array   $rules
  @param array   $messages
  @param array   $customAttributes
docstring_tokens: Validate request for current resource .