From f1e2201ceb5845f2314122415f311716b8c073ba Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 25 Feb 2025 11:10:08 +0000 Subject: [PATCH] Update example in the docs --- README.md | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 57bbdbb9..4ea52a56 100644 --- a/README.md +++ b/README.md @@ -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', + ]; + } } ```