Laravel 表单 ID(使用 Ajax)

Laravel form id (to use Ajax)

我一直在尝试创建一个将在 Laravel 5.6 中与 Ajax 一起发送的表单,我需要我的表单有一个 ID id='my_super_form'

我使用 laravel-样板并希望使用标准语法 {{ html()->form()->open() }}

不管我怎么做,我得到 <form method='POST' action='url/'>

我试过了:post什么都没有,打开数组,在form()中添加参数,作为简单的参数,作为数组,无论我做什么,我都不会得到更多的动作和方法。我似乎无法获得 id 字段。

API documentation 没有列出有效参数,所以我随机尝试,但除非有语法错误,否则什么都不会起作用...

laravel-boilerplate 使用 spatie html to build forms. Here is the documentation.

要将 id其他属性 添加到您的表单,请使用 attribute()功能:

{{ html()->form()->attribute('id', 'my_super_form')->open() }}