public function enabled() : bool
    {
        if ($this->isEnabled !== null) {
            return $this->isEnabled;
        }

        if (!$this->config->get("antispam.{$this->instanceType}.enabled", true)) {
            return $this->isEnabled = false;
        }

        $disabledEnv = (array) $this->config->get("antispam.{$this->instanceType}.disabled_env", []);

        if (in_array($this->config->get('app.env', 'production'), $disabledEnv)) {
            return $this->isEnabled = false;
        }

        if ($this->instanceType === 'recaptcha') {
            if ($this->config->get('antispam.recaptcha.guests_only', false) && $this->request->user() !== null) {
                return $this->isEnabled = false;
            }
        }

        return $this->isEnabled = true;
    }
public function enabled() : bool
    {
        if ($this->isEnabled !== null) {
            return $this->isEnabled;
        }

        if (!$this->config->get("antispam.{$this->instanceType}.enabled", true)) {
            return $this->isEnabled = false;
        }

        $disabledEnv = (array) $this->config->get("antispam.{$this->instanceType}.disabled_env", []);

        if (in_array($this->config->get('app.env', 'production'), $disabledEnv)) {
            return $this->isEnabled = false;
        }

        if ($this->instanceType === 'recaptcha') {
            if ($this->config->get('antispam.recaptcha.guests_only', false) && $this->request->user() !== null) {
                return $this->isEnabled = false;
            }
        }

        return $this->isEnabled = true;
    }
public function enabled ( ) : bool { if ( $ this -> isEnabled !== null ) { return $ this -> isEnabled ; } if ( ! $ this -> config -> get ( "antispam.{$this->instanceType}.enabled" , true ) ) { return $ this -> isEnabled = false ; } $ disabledEnv = ( array ) $ this -> config -> get ( "antispam.{$this->instanceType}.disabled_env" , [ ] ) ; if ( in_array ( $ this -> config -> get ( 'app.env' , 'production' ) , $ disabledEnv ) ) { return $ this -> isEnabled = false ; } if ( $ this -> instanceType === 'recaptcha' ) { if ( $ this -> config -> get ( 'antispam.recaptcha.guests_only' , false ) && $ this -> request -> user ( ) !== null ) { return $ this -> isEnabled = false ; } } return $ this -> isEnabled = true ; }
Check enabled status.

@return bool
Check enabled status .