protected function controllerUsesHelpersTrait()
    {
        if (! $controller = $this->getControllerInstance()) {
            return false;
        }

        $traits = [];

        do {
            $traits = array_merge(class_uses($controller, false), $traits);
        } while ($controller = get_parent_class($controller));

        foreach ($traits as $trait => $same) {
            $traits = array_merge(class_uses($trait, false), $traits);
        }

        return isset($traits[Helpers::class]);
    }