I have a form in which I save an image, I save the image in the folder successfully, but the new image path with its new name is not saved in the database.
Save something like:
"C:\xampp\tmp\php71AA.tmp"'
This is the part I use to get the new address:
$input -> imagen_producto = asset($path);
Here I leave the driver code.
public function store(CreateproductoRequest $request)
{
$input = $request->all();
if($request->file('imagen_producto'))
{
$path = Storage::disk('public')->put('image',$request->file('imagen_producto'));
$input -> imagen_producto = asset($path);
}
$producto = $this->productoRepository->create($input);
Flash::success('Producto saved successfully.');
return redirect(route('producto.index'));
}