Skip to content

Commit

Permalink
More reliably detect SoftDeletes trait
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmcdonald-uk committed Nov 28, 2016
1 parent e704e62 commit 7a76067
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/Userstamps.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@ public static function registerListeners()
static::creating('Wildside\Userstamps\Listeners\Creating@handle');
static::updating('Wildside\Userstamps\Listeners\Updating@handle');

if( method_exists(get_called_class(), 'deleting') )
{
if (in_array('Illuminate\Database\Eloquent\SoftDeletes', class_uses(get_called_class()))) {
static::deleting('Wildside\Userstamps\Listeners\Deleting@handle');
}

if( method_exists(get_called_class(), 'restoring') )
{
static::restoring('Wildside\Userstamps\Listeners\Restoring@handle');
}
}
Expand Down

0 comments on commit 7a76067

Please sign in to comment.