{"record":{"id":"3acd0eda6d9a3f1a","repo":"aimeos/aimeos-laravel","slug":"abort-404-resolvecontroller","errorCode":null,"errorMessage":"abort( 404 );","messagePattern":"abort\\( 404 \\);","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"src/Controller/ResolveController.php","lineNumber":63,"sourceCode":"\t\t\treturn $this->product( $context, $path );\n\t\t};\n\n\t\tself::$fcn['catalog'] = function( \\Aimeos\\MShop\\ContextIface $context, string $path ) {\n\t\t\treturn $this->catalog( $context, $path );\n\t\t};\n\t}\n\n\n\t/**\n\t * Returns the html of the resolved URLs.\n\t *\n\t * @param \\Illuminate\\Http\\Request $request Laravel request object\n\t * @return \\Illuminate\\Http\\Response Laravel response object containing the generated output\n\t */\n\tpublic function indexAction( \\Illuminate\\Http\\Request $request )\n\t{\n\t\tif( ( $path = $request->route( 'path', $request->input( 'path' ) ) ) === null ) {\n\t\t\tabort( 404 );\n\t\t}\n\n\t\t$context = app( 'aimeos.context' )->get( true );\n\n\t\tforeach( array_reverse( self::$fcn ) as $name => $fcn )\n\t\t{\n\t\t\ttry {\n\t\t\t\treturn call_user_func_array( $fcn->bindTo( $this, static::class ), [$context, $path] );\n\t\t\t} catch( \\Exception $e ) {\n\t\t\t\tif( $e->getCode() !== 404 ) throw $e;\n\t\t\t}\n\t\t}\n\n\t\tabort( 404 );\n\t}\n\n\n\t/**","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/aimeos/aimeos-laravel/blob/9879c60332e9fc6611450be9879f5eb1a93c887c/src/Controller/ResolveController.php#L45-L81","documentation":"The Aimeos ResolveController::indexAction() resolves a URL path via registered resolver functions (product, catalog, ...). It aborts with HTTP 404 when no path is present in the route or request input at all — i.e. the endpoint was hit without anything to resolve. The route/resolve controller requires a 'path' route parameter or '?path=' query/input parameter to work.","triggerScenarios":"A request reaches the resolve route without a {path} route parameter and without a 'path' query/input parameter, so $request->route('path', $request->input('path')) returns null and abort(404) is raised at src/Controller/ResolveController.php:63.","commonSituations":"Route definition changed or was overridden without the {path} placeholder; a client or redirect calls the resolve endpoint without the path parameter; custom middleware/URL rewriting strips the path; upgrading Aimeos and copying an old route that doesn't pass 'path'.","solutions":["Ensure the route to ResolveController includes a {path} placeholder, e.g. Route::get('/shop/{path}', ...)->where('path', '.*')","Call the endpoint with the path either as a route segment or as ?path=... query parameter","Check that any redirect/rewrite pointing to the resolve route actually forwards the original path","Compare your routes with the packaged aimeos-shop routes file after upgrades"],"exampleFix":"// before\nRoute::get('/resolve', [\\Aimeos\\Shop\\Controller\\ResolveController::class, 'indexAction']);\n// after\nRoute::get('/resolve/{path}', [\\Aimeos\\Shop\\Controller\\ResolveController::class, 'indexAction'])->where('path', '.*');","handlingStrategy":"validation","validationCode":"$path = $request->route('path', $request->input('path'));\nif( !is_string( $path ) || $path === '' ) {\n    abort( 404, 'No path given to resolve' ); // fail fast before calling the controller\n}","typeGuard":"function hasResolvePath( \\Illuminate\\Http\\Request $request ): bool {\n    $path = $request->route( 'path', $request->input( 'path' ) );\n    return is_string( $path ) && $path !== '';\n}","tryCatchPattern":"try {\n    return $controller->indexAction( $request );\n} catch( \\Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException $e ) {\n    if( !hasResolvePath( $request ) ) {\n        return response()->view('errors.no-path', [], 404);\n    }\n    throw $e;\n}","preventionTips":["Always define the resolve route with a {path} wildcard","Verify inbound links/redirects pass a path segment or ?path= parameter","Write a feature test hitting the resolve route without a path to catch route regressions","Re-check route definitions after Aimeos package upgrades"],"tags":["http-404","laravel","routing","missing-parameter"],"backgroundTag":"missing-required-argument","analyzedSha":"9879c60332e9fc6611450be9879f5eb1a93c887c","analyzedAt":"2026-09-12T15:16:33.901Z","contentChangedAt":"2026-09-12T15:16:33.901Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}