From 1848512cf45107095fea7555dae1a86f69fb99be Mon Sep 17 00:00:00 2001 From: Dmitri Chebotarev Date: Tue, 12 Sep 2023 17:21:18 +0100 Subject: [PATCH] fixed legacy PHP syntax --- routing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routing.md b/routing.md index 1a050fbd615..71a83935072 100644 --- a/routing.md +++ b/routing.md @@ -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; });