Regular Expression Constraints
You may constrain the format of your route parameters using the
where method on a route instance. The where method accepts the name of the parameter and a regular expression defining how the parameter should be constrained:Example:
Route::get('/user/{name}', function ($name) {
return "Letter Route Working with Upper Case & Lower Case";
})->where('name', '[A-Za-z]+');
O/P



Comments
Post a Comment