This avoids the issue where replacing file.PNG with newfile.png fails due to "PNG" not being equal to "png"
*/
public function updateImageFile(Image $image, UploadedFile $file): void
{
- if ($file->getClientOriginalExtension() !== pathinfo($image->path, PATHINFO_EXTENSION)) {
+ if (strtolower($file->getClientOriginalExtension()) !== strtolower(pathinfo($image->path, PATHINFO_EXTENSION))) {
throw new ImageUploadException(trans('errors.image_upload_replace_type'));
}