Skip to content

Commit

Permalink
Merge pull request #190 from miken32/form-route-method
Browse files Browse the repository at this point in the history
Add documentation for new FormElement::route() method
  • Loading branch information
freekmurze authored Jul 21, 2023
2 parents f1c2778 + 18f3906 commit 0ce9b23
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/general-usage/html-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ Generally speaking you'll want to use this in combination with `open()` and `clo
</form>
```

The `route()` method can be chained to `form()` to simplify the specification of a form's action URI:
```html
{{ html()->form('PUT')->route('item.update') }}
```
This uses Laravel's [`route()` helper](https://laravel.com/docs/10.x/helpers#method-route) under the hood and accepts the same arguments.


### Building a form with a model

To make things easier we've added the `modelForm()` and `closeModelForm()` methods to easily open and close a form that's coupled to a model. Under the hood the `model()` and `endModel()` methods are used.
Expand Down

0 comments on commit 0ce9b23

Please sign in to comment.