Skip to content

Commit f3c2ee1

Browse files
authored
Add RevisionSaving event (#194)
1 parent 345b6e7 commit f3c2ee1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Revisions/Revision.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Illuminate\Database\Eloquent\Model;
66
use Statamic\Events\RevisionDeleted;
77
use Statamic\Events\RevisionSaved;
8+
use Statamic\Events\RevisionSaving;
89
use Statamic\Revisions\Revision as FileEntry;
910
use Statamic\Revisions\WorkingCopy;
1011

@@ -78,6 +79,10 @@ public function model($model = null)
7879

7980
public function save()
8081
{
82+
if (RevisionSaving::dispatch($this) === false) {
83+
return false;
84+
}
85+
8186
$this->model->save();
8287

8388
RevisionSaved::dispatch($this);

0 commit comments

Comments
 (0)