Skip to content

Commit

Permalink
Fix typos and formatting in controllers.md
Browse files Browse the repository at this point in the history
  • Loading branch information
liamja authored Sep 30, 2020
1 parent 98b5402 commit 884b07d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ You may register many resource controllers at once by passing an array to the `r

#### Actions Handled By Resource Controller

Verb | URI | Action | Route Name
----------|-----------------------|--------------|---------------------
Verb | URI | Action | Route Name
----------|------------------------|--------------|---------------------
GET | `/photos` | index | photos.index
GET | `/photos/create` | create | photos.create
POST | `/photos` | store | photos.store
Expand Down Expand Up @@ -217,7 +217,7 @@ This route will register a nested resource that may be accessed with URIs like t

#### Scoping Nested Resources

Laravel's [implicit model binding](/docs/{{version}}/routing#implicit-model-binding-scoping) feature can automatically scope nested bindings such that the resolved child model is confirmed to belong to the parent model. By using the `scoped` method when defining your nested resource, you may enabling automatic scoping as well as instruct Laravel which field the child resource should be retrieved by:
Laravel's [implicit model binding](/docs/{{version}}/routing#implicit-model-binding-scoping) feature can automatically scope nested bindings such that the resolved child model is confirmed to belong to the parent model. By using the `scoped` method when defining your nested resource, you may enable automatic scoping as well as instruct Laravel which field the child resource should be retrieved by:

Route::resource('photos.comments', PhotoCommentController::class)->scoped([
'comment' => 'slug',
Expand All @@ -229,7 +229,7 @@ This route will register a scoped nested resource that may be accessed with URIs

#### Shallow Nesting

Often, it is not entirely necessary to have both the parent and the child IDs within a URI since the child ID is already a unique identifier. When using unique identifier such as auto-incrementing primary keys to identify your models in URI segments, you may choose to use "shallow nesting":
Often, it is not entirely necessary to have both the parent and the child IDs within a URI since the child ID is already a unique identifier. When using unique identifiers such as auto-incrementing primary keys to identify your models in URI segments, you may choose to use "shallow nesting":

Route::resource('photos.comments', CommentController::class)->shallow();

Expand Down

0 comments on commit 884b07d

Please sign in to comment.