Laravel 5.6 save from multiple form
Clash Royale CLAN TAG#URR8PPP
Laravel 5.6 save from multiple form
I had HTML form which is like
<form method="post" action="url('results')" enctype="multipart/form-data">
@csrf
<input type="hidden" name="periode" value="1">
<div class="row">
<div class="form-group col-md-4">
<label for="Name">1st Place:</label>
<input type="hidden" name="results[place]" value="1">
<input type="number" maxlength="4" class="form-control" name="results[number]">
</div>
</div>
<div class="row">
<div class="form-group col-md-4">
<label for="Name">2nd Place:</label>
<input type="hidden" name="results[place]" value="2">
<input type="number" min="0000" max="9999" class="form-control" name="results[number]">
</div>
</div>
<div class="row">
<div class="col-md-4"></div>
<div class="form-group col-md-4" style="margin-top:60px">
<button type="submit" class="btn btn-success">Submit</button>
</div>
</div>
</form>
Controller
public function store(Request $request)
$results = new AppResult;
$results->results_place = $request->input('results.place.*');
$results->results_number = $request->input('results.number.*');
$results -> save();
return redirect('results')->with('success', 'Information has been added');
Error
"Argument 1 passed to IlluminateDatabaseGrammar::parameterize() must be of the type array, string given, called in D:worklaraveltestvendorlaravelframeworksrcIlluminateDatabaseQueryGrammarsGrammar.php on line 743 ◀"
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
duplicate of stackoverflow.com/questions/47448504/… ?
– gil
Aug 10 at 13:38