Route::get('/user/{customParameter}', function ($customParameter) {
return 'Custom Parameter: ' . $customParameter;
});
code
Define Dynamic Route with Parameter in Laravel
This Laravel route definition creates a dynamic route that includes a parameter {customParameter}. The closure function receives the value of the parameter and returns a response. The comments provide explanations for each part of the code.
Routing
Route Parameter
Dynamic Route