only('show'); $routeRules[0]['match'] = ['prefixes' => '*', 'domains' => '*']; $matcher = new RouteMatcher(); $matchedRoutes = $matcher->getRoutes($routeRules); foreach ($matchedRoutes as $matchedRoute) { $route = $matchedRoute->getRoute(); $this->assertEquals('things/{thing}', $route->uri); $endpoint = new ExtractedEndpointData([ 'route' => $route, 'uri' => $route->uri, 'httpMethods' => $route->methods, ]); $this->assertEquals('things/{id}', $endpoint->uri); } Route::apiResource('things.otherthings', TestController::class) ->only( 'destroy'); $routeRules[0]['match'] = ['prefixes' => '*/otherthings/*', 'domains' => '*']; $matchedRoutes = $matcher->getRoutes($routeRules); foreach ($matchedRoutes as $matchedRoute) { $route = $matchedRoute->getRoute(); $this->assertEquals('things/{thing}/otherthings/{otherthing}', $route->uri); $endpoint = new ExtractedEndpointData([ 'route' => $route, 'uri' => $route->uri, 'httpMethods' => $route->methods, ]); $this->assertEquals('things/{id}/otherthings/{otherthing_id}', $endpoint->uri); } } }