use method directive
This commit is contained in:
parent
14a15674a3
commit
cb7b1ba8e4
|
@ -174,9 +174,11 @@ If you are using route model binding and would like the resource controller's me
|
|||
|
||||
#### 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_field` helper can create this field for you:
|
||||
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:
|
||||
|
||||
{{ method_field('PUT') }}
|
||||
<form action="/foo/bar" method="POST">
|
||||
@method('PUT')
|
||||
</form>
|
||||
|
||||
<a name="restful-partial-resource-routes"></a>
|
||||
### Partial Resource Routes
|
||||
|
|
|
@ -348,9 +348,11 @@ HTML forms do not support `PUT`, `PATCH` or `DELETE` actions. So, when defining
|
|||
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
||||
</form>
|
||||
|
||||
You may use the `method_field` helper to generate the `_method` input:
|
||||
You may use the `@method` Blade directive to generate the `_method` input:
|
||||
|
||||
{{ method_field('PUT') }}
|
||||
<form action="/foo/bar" method="POST">
|
||||
@method('PUT')
|
||||
</form>
|
||||
|
||||
<a name="accessing-the-current-route"></a>
|
||||
## Accessing The Current Route
|
||||
|
|
Loading…
Reference in New Issue