You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-2
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,8 @@
21
21
+[Interacting with records](#interacting-with-records)
22
22
-[Published revision](#published-revision)
23
23
-[Current Revision](#current-revision)
24
+
-[Revisions](#revisions)
25
+
-[Preview mode](#preview-mode)
24
26
*[Testing](#testing)
25
27
*[Changelog](#changelog)
26
28
*[Contributing](#contributing)
@@ -248,8 +250,6 @@ To fetch the current revision you can call the `current` scope.
248
250
$posts = Post::current()->get();
249
251
```
250
252
251
-
You can implement a preview mode for your frontend by calling the `current` scope when fetching records.
252
-
253
253
#### Revisions
254
254
255
255
Every time a record is updated a new row/revision will be inserted. The default number of revisions kept is 10, this can be updated in the published config file.
Deleting a record will also delete all of its revisions. Soft deleting records will soft delete the revisions and restoring records will restore the revisions.
265
265
266
+
If you need to update a record without creating revision
267
+
268
+
```php
269
+
$post->withoutRevision()->update($options);
270
+
```
271
+
272
+
#### Preview Mode
273
+
274
+
Enabling preview mode will disable the global scope that fetches only published records and will instead fetch the current revision regardless of published state.
0 commit comments