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
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,7 +109,8 @@ By default, the Eloquent Driver stores all data in a single `data` column. Howev
109
109
php artisan migrate
110
110
```
111
111
112
-
4. If you're adding `json` or `integer` columns, you will need to provide your own `Entry` model in order to set the appropriate casts. You can do this by creating a new model which extends the default `Entry` model:
112
+
4. If you're adding a column that [requires an Eloquent cast](https://laravel.com/docs/master/eloquent-mutators#attribute-casting) (eg. a `json` or `integer` column), you will need to provide your own `Entry` model in order to set the appropriate casts. You can do this by creating a new model which extends the default `Entry` model:
113
+
113
114
```php
114
115
<?php
115
116
@@ -134,6 +135,13 @@ By default, the Eloquent Driver stores all data in a single `data` column. Howev
134
135
```php
135
136
class Entry extends \Statamic\Eloquent\Entries\UuidEntryModel
136
137
```
138
+
139
+
Once created, you will need to update the model in the `entries` section of the configuration file:
5. If you have existing entries, you will need to re-save them to populate the new columns. You can do this by pasting the following snippet into `php artisan tinker`:
0 commit comments