From bbcc2bbb1c24a3d7b19f6822ce6a2acde54c162c Mon Sep 17 00:00:00 2001 From: Jacob Baker-Kretzmar Date: Thu, 16 May 2024 14:32:28 -0400 Subject: [PATCH] Wip --- src/Ziggy.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Ziggy.php b/src/Ziggy.php index bc23dcb0..247029e4 100644 --- a/src/Ziggy.php +++ b/src/Ziggy.php @@ -142,10 +142,8 @@ private function nameKeyedRoutes() $routes->put($name, $route); }); - $allRoutes = $this->folioRoutes(); - - $routes->map(function ($route, $name) use ($bindings, $allRoutes) { - $allRoutes->put( + return tap($this->folioRoutes(), fn ($all) => $routes->each( + fn ($route, $name) => $all->put( $name, collect($route)->only(['uri', 'methods', 'wheres']) ->put('domain', $route->domain()) @@ -159,10 +157,8 @@ private function nameKeyedRoutes() return $collection->put('middleware', $route->middleware()); }) ->filter() - ); - }); - - return $allRoutes; + ) + )); } /**