I am new to Laravel. While adding the update option dynamically into my site, the BLOB image is not being updated. Here is my function :
public function update_giftcard($id , Request $data){
$gift['name'] = $data->name;
$gift['description'] = $data->description;
$gift['category'] = $data->category;
/*IMG STORAGE*/
if($data->hasFile('img')) {
$image = $data->file('img')->getClientOriginalName();
$data->file('img')->move("uploads", $image);
$gift['image'] = $image;
}
Giftcards::where('id' , $id)->first()->update($gift);
}
Here when I do echo $gift['image'], the filename is printed successfully and the image is being uploaded successfully too but it is not being updated in the mysql database.
Hope I get an answer, thanks.