Skip to content

Commit

Permalink
Update example in the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed Feb 25, 2025
1 parent bc82a44 commit f1e2201
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,18 @@ By default, the Eloquent Driver stores all data in a single `data` column. Howev

class Entry extends \Statamic\Eloquent\Entries\EntryModel
{
protected $casts = [
// The casts from Statamic's base model...
'date' => 'datetime',
'data' => 'json',
'published' => 'boolean',

// Your custom casts...
'featured_images' => 'json',
];
protected function casts(): array
{
return [
// The casts from Statamic's base model...
'date' => 'datetime',
'data' => 'json',
'published' => 'boolean',

// Your custom casts...
'featured_images' => 'json',
];
}
}
```

Expand Down

0 comments on commit f1e2201

Please sign in to comment.