I have a Real Estate Directory website in Laravel, where I have stored lot of images around 2000+ records stored.
Now, I'm trying to add new resize images for my mobile device. I want to perform this task on product controller UPDATING FUNCTION. when user click on product update form button without selecting any new images.
From the Previous stored images will resize & store on new location. Previous images contains its dimensions and location. Just add new resize images on clicking updating the product form. Please Help. I'm stuck from 2 days.
$gallery_images_name = PropertyGallery::where('property_id', $id)->pluck('image_name');
$galcount=0;
foreach($gallery_images_name as $key => $gallery_image_name)
{
$name = 'property_' . $galcount . time() . '.' . $gallery_image_name;
$img = Image::make($gallery_image_name->getRealPath());
$img->resize(124, 182, function ($constraint)
{
$constraint->aspectRatio();
})->save(public_path() . '/upload/m_gallery/' . 'mobile_property_'.$name);
}