Skip to content

Commit

Permalink
documenting a PR from the framework
Browse files Browse the repository at this point in the history
The PR in Laravel's repo laravel/framework#18606
  • Loading branch information
itainathaniel authored Jun 27, 2019
1 parent 6dd23fd commit aeb7fa1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ If you are using route model binding and would like the resource controller's me

php artisan make:controller PhotoController --resource --model=Photo

#### Specifying The Parent Model

when we have polymorphic relationships, we often have nested routes and controllers. If you want to associate your controller to two Models, a model and its parent, you may use the `--parent` option alongside with the `--model` option:

php artisan make:controller PostTagsController --model=Tag --parent=Post

#### Spoofing Form Methods

Since HTML forms can't make `PUT`, `PATCH`, or `DELETE` requests, you will need to add a hidden `_method` field to spoof these HTTP verbs. The `@method` Blade directive can create this field for you:
Expand Down

0 comments on commit aeb7fa1

Please sign in to comment.