From bf75908a8836a69bb0b3e60d291964ef37e6b28d Mon Sep 17 00:00:00 2001 From: Chris Mellor Date: Wed, 28 Feb 2024 14:36:00 +0000 Subject: [PATCH] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index dd174c6..9db8f34 100644 --- a/README.md +++ b/README.md @@ -163,12 +163,21 @@ Approval::find(1)->approve(persist: false); If you need to roll back an approval, you can use the `rollback` method. +> [!NOTE] +> By default, a Rollback will bypass been added back to the `approvals` table + ```php Approval::first()->rollback(); ``` This will revert the data and set the state to `pending` and touch the `rolled_back_at` timestamp, so you have a record of when it was rolled back. +If you want a Rollback to be re-approved, pass the `bypass` parameter as `false` to the `rollback` method + +```php +Approval::first()->rollback(bypass: false); // default is true +``` + ### Conditional Rollbacks A roll-back can be conditional, so you can roll back an approval if a condition is met.