Clean Framework · DOCUMENTATION
Add a constrained named route
Add a constrained named route
Steps
Declare literals before broad parameter routes, choose the HTTP method, and name the route.
// Registration fragment; import Router and your application controller.
$router->get('/reading/{slug}', ReadingListController::class . '::show')
->where('slug', 'slug')
->name('reading.show');The controller receives Request plus a parameter array, not a scalar slug. A constraint validates shape; it does not establish existence or authorization. Add middleware explicitly for private routes.
Verify
Test a known value, an absent value, malformed input, and the wrong method. See Routing and middleware and route source.
Editorial provenance
Source: resources/guides/route.md. Source SHA-256: c034153bcdec2877f3907bc65c347bda86aeb4566cd14ab7d3e998ce35dee768.
Knowledge-base application source; editorial checkpoint 2026-10-20. See candidate status and adoption boundary.