Skip to content

Commit

Permalink
fixed legacy PHP syntax (#9024)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitrev authored Sep 12, 2023
1 parent 17bd1d4 commit fca85ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@ If your route has dependencies that you would like the Laravel service container

Occasionally you may need to specify a route parameter that may not always be present in the URI. You may do so by placing a `?` mark after the parameter name. Make sure to give the route's corresponding variable a default value:

Route::get('/user/{name?}', function (string $name = null) {
Route::get('/user/{name?}', function (?string $name = null) {
return $name;
});

Route::get('/user/{name?}', function (string $name = 'John') {
Route::get('/user/{name?}', function (?string $name = 'John') {
return $name;
});

Expand Down

0 comments on commit fca85ee

Please sign in to comment.