Skip to content

Commit 05d242f

Browse files
include example of route function arguments (laravel#7263)
Co-authored-by: Andrew Minion <[email protected]>
1 parent a9f777b commit 05d242f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

urls.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Each of these methods may also be accessed via the `URL` [facade](/docs/{{versio
5353

5454
The `route` helper may be used to generate URLs to [named routes](/docs/{{version}}/routing#named-routes). Named routes allow you to generate URLs without being coupled to the actual URL defined on the route. Therefore, if the route's URL changes, no changes need to be made to your calls to the `route` function. For example, imagine your application contains a route defined like the following:
5555

56-
Route::get('/post/{post}', function () {
56+
Route::get('/post/{post}', function (Post $post) {
5757
//
5858
})->name('post.show');
5959

@@ -65,7 +65,7 @@ To generate a URL to this route, you may use the `route` helper like so:
6565

6666
Of course, the `route` helper may also be used to generate URLs for routes with multiple parameters:
6767

68-
Route::get('/post/{post}/comment/{comment}', function () {
68+
Route::get('/post/{post}/comment/{comment}', function (Post $post, Comment $comment) {
6969
//
7070
})->name('comment.show');
7171

0 commit comments

Comments
 (0)