Skip to content

Commit cb7b1ba

Browse files
committed
use method directive
1 parent 14a1567 commit cb7b1ba

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

controllers.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,11 @@ If you are using route model binding and would like the resource controller's me
174174

175175
#### Spoofing Form Methods
176176

177-
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_field` helper can create this field for you:
177+
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:
178178

179-
{{ method_field('PUT') }}
179+
<form action="/foo/bar" method="POST">
180+
@method('PUT')
181+
</form>
180182

181183
<a name="restful-partial-resource-routes"></a>
182184
### Partial Resource Routes

routing.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,11 @@ HTML forms do not support `PUT`, `PATCH` or `DELETE` actions. So, when defining
348348
<input type="hidden" name="_token" value="{{ csrf_token() }}">
349349
</form>
350350

351-
You may use the `method_field` helper to generate the `_method` input:
351+
You may use the `@method` Blade directive to generate the `_method` input:
352352

353-
{{ method_field('PUT') }}
353+
<form action="/foo/bar" method="POST">
354+
@method('PUT')
355+
</form>
354356

355357
<a name="accessing-the-current-route"></a>
356358
## Accessing The Current Route

0 commit comments

Comments
 (0)