Skip to content

Commit

Permalink
Update upgrade.md
Browse files Browse the repository at this point in the history
The example documentation did not indicate that the parameter is optional.

If we use this example, then we get the error:
```php
Missing required parameters for [Route: profile] [URI: profile/{location}].
```
  • Loading branch information
eldario committed Oct 29, 2020
1 parent c3b0124 commit 73d4c08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions upgrade.md
Expand Up @@ -384,7 +384,7 @@ The `rackspace` storage driver has been removed. If you would like to continue u

In previous releases of Laravel, passing associative array parameters to the `route` helper or `URL::route` method would occasionally use these parameters as URI values when generating URLs for routes, even if the parameter value had no matching key within the route path. Beginning in Laravel 6.0, these values will be attached to the query string instead. For example, consider the following route:

Route::get('/profile/{location}', function ($location = null) {
Route::get('/profile/{location?}', function ($location = null) {
//
})->name('profile');

Expand All @@ -396,7 +396,7 @@ In previous releases of Laravel, passing associative array parameters to the `ro

The `action` helper and `URL::action` method are also affected by this change:

Route::get('/profile/{id}', 'ProfileController@show');
Route::get('/profile/{id?}', 'ProfileController@show');

// Laravel 5.8: http://example.com/profile/1
echo action('ProfileController@show', ['profile' => 1]);
Expand Down

0 comments on commit 73d4c08

Please sign in to comment.