Skip to content

Commit 0d1d347

Browse files
committed
Modified the Post model so dates are properly cast to datetimes. Laravel 5.4 now casts date to startOfDay dates by default.
1 parent dbf7546 commit 0d1d347

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Post.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ class Post extends Model implements TaggableInterface
2222
*
2323
* @var array
2424
*/
25-
protected $dates = [
26-
'created_at',
27-
'updated_at',
28-
'published_at',
25+
protected $casts = [
26+
'created_at' => 'datetime',
27+
'updated_at' => 'datetime',
28+
'published_at' => 'datetime',
2929
];
3030

3131
/**

0 commit comments

Comments
 (0)