Skip to content

Commit

Permalink
fix clearFiles method
Browse files Browse the repository at this point in the history
delete thumbnail too if found.
  • Loading branch information
MoamenEltouny committed Feb 14, 2022
1 parent 3f21bd1 commit 8e2397b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/HasFiles.php
Expand Up @@ -148,6 +148,9 @@ public function files()
public function clearFiles()
{
foreach ($this->files()->get() as $file) {
if ($thumb = $file->file->thumbnail)
$thumb->delete();

$file->file->delete();
}
}
Expand Down

0 comments on commit 8e2397b

Please sign in to comment.