I have name
, email
and image
input fields in a view file. I use jquery cloning in the view file. How to store the image
, name
and email
values in the database by using laravel 5.8 creating a method?
This is my code:
public function addMorePost(Request $request) {
$request->validate([
'addmore.*.name' => 'required',
'addmore.*.qty' => 'required',
'addmore.*.price' => 'required',
'addmore.*.image' => 'required',
]);
foreach ($request->addmore as $key => $value) {
ProductStock::create($value);
}
return back()->with('success', 'Record Created Successfully.');
}