protected function parseTrace($index, array $trace)
    {
        $frame = (object) [
            'index'     => $index,
            'namespace' => null,
            'name'      => null,
            'line'      => isset($trace['line']) ? $trace['line'] : '?',
        ];

        if (isset($trace['function']) && $trace['function'] == 'substituteBindings') {
            $frame->name = 'Route binding';

            return $frame;
        }

        if (isset($trace['class']) && isset($trace['file']) && strpos(
                                                                   $trace['file'],
                                                                   DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'laravel' . DIRECTORY_SEPARATOR . 'framework'
                                                               ) === false && strpos(
                                                                                  $trace['file'],
                                                                                  DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'barryvdh' . DIRECTORY_SEPARATOR . 'laravel-debugbar'
                                                                              ) === false
        ) {
            $file = $trace['file'];

            if (isset($trace['object']) && is_a($trace['object'], 'Twig_Template')) {
                list($file, $frame->line) = $this->getTwigInfo($trace);
            } elseif (strpos($file, storage_path()) !== false) {
                $hash = pathinfo($file, PATHINFO_FILENAME);

                if (!$frame->name = $this->findViewFromHash($hash)) {
                    $frame->name = $hash;
                }

                $frame->namespace = 'view';

                return $frame;
            } elseif (strpos($file, 'Middleware') !== false) {
                $frame->name = $this->findMiddlewareFromFile($file);

                if ($frame->name) {
                    $frame->namespace = 'middleware';
                } else {
                    $frame->name = $this->normalizeFilename($file);
                }

                return $frame;
            }

            $frame->name = $this->normalizeFilename($file);

            return $frame;
        }


        return false;
    }