protected function getCustomfields()
    {
        $extensions = extensions();
        $return     = [];
        event('customfields.before.search', $return);
        event(new BeforeSearch($return));

        foreach ($extensions as $name => $extension) {
            $name   = 'antares/' . str_replace(['component-', 'module-'], '', $extension['name']);
            $config = config($name . '::customfields');
            if (empty($config)) {
                continue;
            }
            if (!$this->validate($config)) {
                continue;
            }

            array_walk($config, function(&$value, $key) {
                if (is_array($value)) {

                    foreach ($value as $index => &$customfield) {
                        if (!class_exists($customfield)) {
                            unset($value[$index]);
                            continue;
                        }
                        $customfield = app($customfield);
                    }
                } else {
                    $value = app($value);
                }
            });

            foreach ($config as $name => $customfields) {
                if (isset($return[$name])) {
                    $return[$name] = array_merge($return[$name], $customfields);
                } else {
                    $return[$name] = $customfields;
                }
            }
        }

        event('customfields.after.search', [$return]);
        event(new AfterSearch($return));
        return $return;
    }