Code Duplication    Length = 16-16 lines in 2 locations

src/Http/RouteListController.php 1 location

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

src/View/Components/Table.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
    /**