protected function makeValidator($resource, $class)
    {
        $validator = $this->container->make($class);

        if (method_exists($validator, 'setResourceName')) {
            $validator->setResourceName($resource);
        }
        $this->publish($resource, 'validator.created', [$validator]);
        return $validator;
    }
protected function makeValidator($resource, $class)
    {
        $validator = $this->container->make($class);

        if (method_exists($validator, 'setResourceName')) {
            $validator->setResourceName($resource);
        }
        $this->publish($resource, 'validator.created', [$validator]);
        return $validator;
    }
protected function makeValidator ( $ resource , $ class ) { $ validator = $ this -> container -> make ( $ class ) ; if ( method_exists ( $ validator , 'setResourceName' ) ) { $ validator -> setResourceName ( $ resource ) ; } $ this -> publish ( $ resource , 'validator.created' , [ $ validator ] ) ; return $ validator ; }
Creates the validator and fires an event

@param string $resource
@param string $class
@return \Cmsable\Resource\Contracts\Validator
Creates the validator and fires an event