this is a part of my code:
<div class="row">
<div class="col-lg-2 col-md-12 col-xs-12">
<div class="form-group">
<label for="exampleInputEmail1">Title*</label>
<input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" name="title[]">
</div>
</div>
<div class="col-lg-5 col-md-12 col-xs-12">
<div class="form-group">
<label for="exampleInputEmail1">First Name*</label>
<input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" name="f_name[]">
</div>
</div>
<div class="col-lg-5 col-md-12 col-xs-12">
<div class="form-group">
<label for="exampleInputEmail1">Last Name*</label>
<input type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" name="l_name[]">
</div>
</div>
</div>
and if i click add button, it will show the second form same like above. so how to save all input data into database? this is what i've done in my controller.
public function store(Request $request){
$title = $request->title;
$f_name = $request->f_name;
$l_name = $request->l_name;
$form = new Conference;
$form->name = $title.' '.$f_name.' '.$l_name;
$form->email = $request->email;
$form->phone = $request->phone;
$form->position = $request->position;
$form->category = $request->optradio;
$form->price = $request->price;
$form->t_price = $request->t_price;
$form->company = $request->company;
$form->save();
return redirect()->back()->with('message','REGISTRATION SUCCESS');
}
but it returned an error "Array to string conversion". I know i have to write something in my controller but i don't know what to do. can someone help me?
[]array. now your name will looks liketitle