protected function validatorForResource(
        array $data,
        array $rules,
        array $messages = [],
        array $customAttributes = []
    ): ValidatorInterface
    {
        return $this->factory->createResourceValidator(
            ResourceObject::create($data),
            $rules,
            $messages,
            $customAttributes
        );
    }
protected function validatorForResource(
        array $data,
        array $rules,
        array $messages = [],
        array $customAttributes = []
    ): ValidatorInterface
    {
        return $this->factory->createResourceValidator(
            ResourceObject::create($data),
            $rules,
            $messages,
            $customAttributes
        );
    }
protected function validatorForResource ( array $ data , array $ rules , array $ messages = [ ] , array $ customAttributes = [ ] ) : ValidatorInterface { return $ this -> factory -> createResourceValidator ( ResourceObject :: create ( $ data ) , $ rules , $ messages , $ customAttributes ) ; }
Create a validator for a JSON API resource object.

@param array $data
@param array $rules
@param array $messages
@param array $customAttributes
@return ValidatorInterface
Create a validator for a JSON API resource object .