Code Duplication    Length = 16-16 lines in 2 locations

src/Http/RouteListController.php 1 location

@@ 43-58 (lines=16) @@
40
        $routes = collect($this->router->getRoutes())
41
            ->filter(function ($route) {
42
                return ! $this->matches(config('route-list.excluded'), $route->uri);
43
            })->map(function ($route) {
44
                $name = $route->action['as'] ?? '';
45
46
                if ($name && $this->matches(['/^generated::/'], $name)) {
47
                    $name = '';
48
                }
49
50
                return [
51
                    // 'host' => $route->action['where'],
52
                    'uri' => $route->uri,
53
                    'name' => $name,
54
                    'methods' => $route->methods,
55
                    'action' => $route->action['controller'] ?? 'Closure',
56
                    'middleware' => $this->getRouteMiddleware($route),
57
                ];
58
            });
59
60
        return view('route-list::index', [
61
            'routes' => $routes,

src/View/Components/RouteList.php 1 location

@@ 58-73 (lines=16) @@
55
        return collect($this->router->getRoutes())
56
            ->filter(function ($route) {
57
                return ! $this->matches(config('route-list.excluded'), $route->uri);
58
            })->map(function ($route) {
59
                $name = $route->action['as'] ?? '';
60
61
                if ($name && $this->matches(['/^generated::/'], $name)) {
62
                    $name = '';
63
                }
64
65
                return [
66
                    // 'host' => $route->action['where'],
67
                    'uri' => $route->uri,
68
                    'name' => $name,
69
                    'methods' => $route->methods,
70
                    'action' => $route->action['controller'] ?? 'Closure',
71
                    'middleware' => $this->getRouteMiddleware($route),
72
                ];
73
            });
74
    }
75
76
    /**