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
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ class User extends \Illuminate\Database\Eloquent\Model
63
63
64
64
## Usage
65
65
66
-
### Tables
66
+
### Database Tables
67
67
68
68
You need to add the following columns to your main model table:
69
69
@@ -74,23 +74,23 @@ Furthermore you need a version table. The name of the version table is identical
74
74
*`ref_` followed by the name of the model's primary key (if the primary key is `id`, the column name will be `ref_id`)
75
75
*`version` (integer)
76
76
77
-
### Models
77
+
### Eloquent Models
78
78
79
79
You have to define a `$versioned` array in your model that contains all versioned columns.
80
80
81
-
### Queries
81
+
### Database Queries
82
82
83
-
#### Get versions from database
83
+
#### Query the database
84
84
85
85
By default the query builder will fetch the latest version (e. g. `User::find(1);` will return the latest version of user #1). If you want a specific version or all versions, you can use the following:
86
86
87
87
*`version(VERSION_NO)` returns a specific version<br>Example: `User::version(2)->find(1)` will return version #2 of user #1
88
88
89
89
*`allVersions()` returns all versions of the queried items<br>Example: `User::allVersions()->get()` will return all versions of all users
90
90
91
-
#### Create, update and delete
91
+
#### Create, update and delete records
92
92
93
-
All these operations can be performed normally. The package will automatically generate new versions and will remove all versions on delete.
93
+
All these operations can be performed normally. The package will automatically generate a version 1 on create, the next version on update and will remove all versions on delete.
0 commit comments