How to insert multiple images into the table?
Controller
public function save(Request $request)
{
$images = new Image;
$input = $request->file("image");
if($files=$request->file('image')){
foreach($files as $file){
$name=$file->getClientOriginalName();
$file->move(public_path("/images/"),$name);
$images[]=$name;
$images->Image = $input->getClientOriginalName();
}
}
$images->save();
$image = Image::find($request->id);
return Redirect::to("image")->withSuccess('Great! Image has been successfully uploaded.');
}
I expect to insert images into database, the the error is No message
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire