Laravel 5.6 save from multiple form

The name of the pictureThe name of the pictureThe name of the pictureClash 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 ◀"





duplicate of stackoverflow.com/questions/47448504/… ?
– gil
Aug 10 at 13:38










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.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS