Php 两份表格一份提交Laravel表格
我不熟悉Laravel和php,一直在研究提交不同表单的方法。我现在制作的表单是一个兴趣复选框,它将提交给关注者表。到目前为止,我知道每个兴趣都有它的特定值相等,它将用于显示与兴趣id相关的所有文章 现在我有点被提交兴趣的方式卡住了。我找不到任何从一个表单提交多行的方法。所以现在我给他们制作了多个表单,但是我必须在每个表单上都放置一个提交按钮 是否在一个提交按钮上提交多个表单,或者在一个表单上提交多行 这是我现在的代码 html:Php 两份表格一份提交Laravel表格,php,html,forms,twitter-bootstrap,laravel,Php,Html,Forms,Twitter Bootstrap,Laravel,我不熟悉Laravel和php,一直在研究提交不同表单的方法。我现在制作的表单是一个兴趣复选框,它将提交给关注者表。到目前为止,我知道每个兴趣都有它的特定值相等,它将用于显示与兴趣id相关的所有文章 现在我有点被提交兴趣的方式卡住了。我找不到任何从一个表单提交多行的方法。所以现在我给他们制作了多个表单,但是我必须在每个表单上都放置一个提交按钮 是否在一个提交按钮上提交多个表单,或者在一个表单上提交多行 这是我现在的代码 html: <div class="panel-body">
<div class="panel-body">
@if (count($errors) > 0)
<div class="alert alert-danger">
<strong>Whoops!</strong> There were some problems with your input.<br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
{!! Form::open() !!}
<div class="form-group">
<div class="col-md-6">
{!! Form::label('title','Title:', ['class' => 'col-md-4 control-label']) !!}
{!! Form::checkbox('interest_id', '1', true) !!}
</div>
</div>
{!! Form::close() !!}
{!! Form::open() !!}
<div class="form-group">
<div class="col-md-6">
{!! Form::label('title','Title:', ['class' => 'col-md-4 control-label']) !!}
{!! Form::checkbox('interest_id', '2', true) !!}
</div>
</div>
{!! Form:: submit('Sumbit', ['class' => 'btn btn-primary form-control']) !!}
{!! Form::close() !!}
</div>
可能的重复可能的重复
public function store(InterestRequest $interest)
{
$interest = new Follower(array(
'user_id' => $interest->get('interest_id'),
'follower_id' => Auth::id()
));
$interest->save();
}