From 098cf4600b98fb16ac73f0b4d5768325b6bdc56a Mon Sep 17 00:00:00 2001 From: Eddie Palmans Date: Mon, 4 Feb 2019 13:06:44 +0100 Subject: [PATCH 1/2] Date mutator for 'email_verified_at' attribute on User model stub --- app/User.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/User.php b/app/User.php index fbc0e589..54854c16 100644 --- a/app/User.php +++ b/app/User.php @@ -27,4 +27,13 @@ class User extends Authenticatable protected $hidden = [ 'password', 'remember_token', ]; + + /** + * The attributes that should be mutated to dates. + * + * @var array + */ + protected $dates = [ + 'email_verified_at', + ]; } From 2f37ba38fa8f7cf6a1cda070984459405e90a37a Mon Sep 17 00:00:00 2001 From: Eddie Palmans Date: Mon, 4 Feb 2019 14:28:05 +0100 Subject: [PATCH 2/2] Attribute casting for 'email_verified_at' on User model stub --- app/User.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/User.php b/app/User.php index 54854c16..faa03c3b 100644 --- a/app/User.php +++ b/app/User.php @@ -29,11 +29,11 @@ class User extends Authenticatable ]; /** - * The attributes that should be mutated to dates. + * The attributes that should be cast to native types. * * @var array */ - protected $dates = [ - 'email_verified_at', + protected $casts = [ + 'email_verified_at' => 'datetime', ]; }