Skip to content

Commit

Permalink
Merge pull request #36 from makeabledk/feat/deletion
Browse files Browse the repository at this point in the history
Delete image-files after succesfully deleted db-record
  • Loading branch information
rasmuscnielsen authored Sep 30, 2019
2 parents bba1147 + e12f8f3 commit fe999d3
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 fe999d3

Please sign in to comment.