Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion en/the-basics/views.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ This middleware can be applied to routes to ensure that requests are coming from

::: v-pre
1. Register the middleware (`github.com/goravel/framework/http/middleware::VerifyCsrfToken(exceptPaths)`) to global or a specific route.
2. Add `<input type="hidden" name="_token" value="{{ .csrf_token }}" />` to your form in the view file, or add `X-CSRF-TOKEN={{ .csrf_token }}` to your request header to include the CSRF token.
2. Add `{{ .csrf_field }}` (which renders `<input type="hidden" name="_token" value="{{ .csrf_token }}" />`) to your form in the view file, or add `X-CSRF-TOKEN={{ .csrf_token }}` to your request header to include the CSRF token.
3. The middleware will automatically verify the token on form submission.
:::

Expand Down
Loading