generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
model events docs, add syncToCurrentVersion events
- Loading branch information
1 parent
972b8f1
commit 5656aa7
Showing
6 changed files
with
63 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# FilamentPHP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Model Events | ||
|
||
Laravel Revisor provides several model events for you hook into key publishing and versioning events. | ||
|
||
All events are fired on the Draft record, and pass the relevant published or versioned record as an argument to your | ||
callback (if applicable). | ||
|
||
Event listeners can be registered using static methods on the Model class that correspond to the event name. | ||
|
||
```php | ||
Page::published(function (Page $page, Page $publishedRecord) { | ||
... | ||
}); | ||
``` | ||
|
||
## Publishing Events | ||
|
||
| Event | Description | | ||
|--------------|-----------------------------------| | ||
| publishing | Fired before publishing a Model | | ||
| published | Fired after publishing a Model | | ||
| unpublishing | Fired before unpublishing a Model | | ||
| unpublished | Fired after unpublishing a Model | | ||
|
||
## Versioning Events | ||
|
||
| Event | Description | | ||
|-------------------------|---------------------------------------------| | ||
| savingNewVersion | Fired before saving a new Version | | ||
| savedNewVersion | Fired after saving a new Version | | ||
| syncingToCurrentVersion | Fired before syncing to the current Version | | ||
| syncedToCurrentVersion | Fired after syncing to the current Version | | ||
| revertingToVersion | Fired before reverting to a Version | | ||
| revertedToVersion | Fired after reverting to a Version | |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters