protected function validate($name, $key = null)
    {
        if (!is_null($key)) {
            return Memory::make('forms-config')->get($key);
        }
        $control = $this->runtime->get('control', []);

        /** before middleware gives information about current middleware action and controller * */
        if (empty($control)) {
            return false;
        }
        $keyname       = $this->getFormConfigKey($name, $control);
        /** we will get this from cache * */
        $configuration = Memory::make('forms-config')->get($keyname);
        /** when we dont find any information about form in current route * */
        if (empty($configuration)) {
            return false;
        }
        /** when current action is not same with action from form configuration * */
        if ((int) $control['action_id'] !== (int) $configuration['action']) {
            return false;
        }
        return $configuration;
    }