Skip to content

Commit

Permalink
[9.x] Add restoreQuietly functionality (laravel#43550)
Browse files Browse the repository at this point in the history
* [9.x]: add restoreQuietly functionality

* [9.x]: add restoreQuietly functionality - return type fix
  • Loading branch information
veneliniliev authored and Ken committed Aug 9, 2022
1 parent b76b904 commit 32ba1b3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Illuminate/Database/Eloquent/SoftDeletes.php
Expand Up @@ -128,6 +128,16 @@ public function restore()
return $result;
}

/**
* Restore a soft-deleted model instance without raising any events.
*
* @return bool|null
*/
public function restoreQuietly()
{
return static::withoutEvents(fn () => $this->restore());
}

/**
* Determine if the model instance has been soft-deleted.
*
Expand Down

0 comments on commit 32ba1b3

Please sign in to comment.