This error message usually occurs when the file path is incorrect or the file permissions are not set correctly. Here are a few things you can try:
Check the file path: Make sure that the file path you are using is correct. Double-check the spelling and make sure that the file exists in the specified location.
Check file permissions: Make sure that the file has the correct permissions set. The file should be readable by the web server user. You can set the file permissions using the chmod command.
Check upload directory permissions: Make sure that the directory where you are uploading the file has the correct permissions set. The directory should be writable by the web server user. You can set the directory permissions using the chmod command.
Here's an example of how to set the file and directory permissions using the chmod command:
if (!empty($site_info->logo)) {
Storage::delete($site_info->logo);
}
You could also wrap the delete in a try-catch block
For the future, please make sure you post the complete error message including which line in your code errors. I'm assuming its the file delete that is failing.
@Snapey Same code works my another controller. In this error i search in google but can't properly ans . I think code is okay . when i upload IMG-2232333.jpg extension file show this error. but another dsfsdflsf.jpg file upload properly.