File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ protected function newRevision(): void
92
92
// This model has been set not to create a revision
93
93
|| $ this ->shouldCreateRevision () === false
94
94
// The record is being soft deleted or restored
95
- || $ this ->isDirty ('deleted_at ' )
95
+ || $ this ->isDirty (method_exists ( $ this , ' getDeletedAtColumn ' ) ? $ this -> getDeletedAtColumn () : 'deleted_at ' )
96
96
// A listener of the creatingRevision event returned false
97
97
|| $ this ->fireModelEvent ('creatingRevision ' ) === false
98
98
) {
@@ -106,8 +106,8 @@ protected function newRevision(): void
106
106
return ;
107
107
}
108
108
109
- $ revision ->created_at = $ this ->created_at ;
110
- $ revision ->updated_at = $ this ->updated_at ;
109
+ $ revision ->{ $ this -> getCreatedAtColumn ()} = $ this ->{ $ this -> getCreatedAtColumn ()} ;
110
+ $ revision ->{ $ this -> getUpdatedAtColumn ()} = $ this ->{ $ this -> getUpdatedAtColumn ()} ;
111
111
$ revision ->is_current = false ;
112
112
$ revision ->is_published = false ;
113
113
@@ -337,7 +337,7 @@ public function pruneRevisions()
337
337
{
338
338
self ::withoutEvents (function () {
339
339
$ revisionsToKeep = $ this ->revisions ()
340
- ->orderByDesc (' updated_at ' )
340
+ ->orderByDesc ($ this -> getUpdatedAtColumn () )
341
341
->onlyDrafts ()
342
342
->withoutCurrent ()
343
343
->take (config ('drafts.revisions.keep ' ))
You can’t perform that action at this time.
0 commit comments