Skip to content

Commit d333ad2

Browse files
Update dedicated column docs (#397)
* Update dedicated column docs * wip
1 parent b7a2de3 commit d333ad2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ By default, the Eloquent Driver stores all data in a single `data` column. Howev
109109
php artisan migrate
110110
```
111111

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+
113114
```php
114115
<?php
115116

@@ -134,6 +135,13 @@ By default, the Eloquent Driver stores all data in a single `data` column. Howev
134135
```php
135136
class Entry extends \Statamic\Eloquent\Entries\UuidEntryModel
136137
```
138+
139+
Once created, you will need to update the model in the `entries` section of the configuration file:
140+
141+
```diff
142+
- 'model' => \Statamic\Eloquent\Entries\EntryModel::class,
143+
+ 'model' => \App\Models\Entry::class,
144+
```
137145

138146
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`:
139147
```php

0 commit comments

Comments
 (0)