Laravel 5.5添加表单ID

时间:2017-12-23 09:29:21

标签: forms laravel-5 laravel-5.5 laravelcollective laravel-form

我有以下内容: {!! Form::model($houses, ['method' => 'PATCH','route' => ['houses.update', $houses->id]]) !!}

{!! Form::open(array('route' => 'houses.store','method'=>'POST')) !!}

女巫导致: <form method="POST" action="http://localhost/j/public_html/houses/2" accept-charset="UTF-8">

<form method="POST" action="http://localhost/j/public_html/houses" accept-charset="UTF-8">

如何在两者中添加<form id="houseform" ...

由于

1 个答案:

答案 0 :(得分:2)

您可以使用:

{!! Form::model($houses, [
           'method' => 'PATCH',
           'route' => ['houses.update', $houses->id], 
           'id' => 'houseform'
   ]) !!}

类似于第二名:

{!! Form::open(array('route' => 'houses.store','method'=>'POST', 'id' => 'houseform')) !!}