Skip to content

Commit

Permalink
Delete image-files after succesfully deleted db-record
Browse files Browse the repository at this point in the history
  • Loading branch information
RTC1 authored and rasmuscnielsen committed Sep 30, 2019
1 parent bba1147 commit e12f8f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ enabled:

disabled:
- length_ordered_imports
- self_accessor
2 changes: 1 addition & 1 deletion src/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Image extends Model implements ResponsiveImage
public static function boot()
{
parent::boot();
static::deleting(function (self $image) {
static::deleted(function (Image $image) {
dispatch(new DeleteCloudImage($image->path));
});
}
Expand Down

0 comments on commit e12f8f3

Please sign in to comment.