This is the function that I have that saves the image everything works fine, but I want to know how I can do to resize the images and fill the images to not distort, like adding a margin, either vertically or horizontally according to as necessary to resize the image without distorting it.
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'] = $path;
}
$producto = $this->productoRepository->create($input);
Flash::success('Producto saved successfully.');
return redirect(route('producto.index'));
}
Install Intervention Image
The code stayed like this:
image = $request->file('imagen_producto');
$image_resize = Image::make($image->getRealPath())->resize(300,300);
$path = Storage::disk('public')->put('image',$image_resize->file('imagen_producto'));
$input['imagen_producto'] = $path;
Now I miss this error
NotSupportedException in AbstractDriver.php line 117:
Command (File) is not available for driver (Gd).