We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb4b37c commit 5141f88Copy full SHA for 5141f88
model/Upload.php
@@ -34,14 +34,17 @@ public function getUrlAttribute()
34
return $url;
35
}
36
37
- public function deleteFile()
+ public function deleteFile($autoSave = true)
38
{
39
if ($this->path) {
40
$disk = \Storage::disk($this->disk);
41
if ($disk->exists($this->path)) {
42
$disk->delete($this->path);
43
$this->path = '';
44
- $this->save();
+ if($autoSave)
45
+ {
46
+ $this->save();
47
+ }
48
49
50
src/UploadManagerServiceProvider.php
@@ -42,7 +42,7 @@ public function boot()
$modelClassName::deleted(
function ($upload) {
//
- $upload->deleteFile();
+ $upload->deleteFile(false);
);
0 commit comments