public static function saveOgImage($list) { $imagePath = public_path($list->image); $ogImagePath = ListHelpers::getListOGPathFromImage($imagePath); try { $image = self::getOgImageObject($list); $image->save($ogImagePath); } catch (Intervention\Image\Exception\NotReadableException $e) { throw new Exception('Error saving thumbnail! Invalid image!'); } catch (Intervention\Image\Exception\NotWritableException $e) { throw new Exception('Error saving thumbnail! Permission issue! Contact site admin'); } }