Level 102
What line throws that error? The error message should be longer than just "Unable to init from given binary data."
hi i want to ask
I have 2 applications with image uploads contained in 2 applications
in the first application the image update was successful but in the second application an error appeared
Unable to init from given binary data.
update function
public function update(Request $request, Produk $produck)
{
$this->validate($request, [
'kategori_id' => 'required',
'name' => 'required',
'harga' => 'required',
'stok' => 'required',
'desk' => 'required',
]);
$this->storeImage($produck);
return redirect()->back();
}
storeImage
private function storeImage($produck){
if(request()->has('image')){
$produck->update([
'image' => request()->image->store('uploads','public'),
]);
$image = Image::make(public_path('storage/'. $produck->image))->fit(300,300, null, 'top-left');
$image->save();
}
}
thx
Please or to participate in this conversation.