From db6faa70d35e5e3bd031c9a8bdf0be2ef4919703 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Thu, 1 Oct 2015 21:05:14 +0100 Subject: [PATCH] Moved dates to casts --- app/Models/Component.php | 8 +------- app/Models/Incident.php | 13 ++++--------- app/Models/Subscriber.php | 8 +------- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/app/Models/Component.php b/app/Models/Component.php index 50fe616d..aebb7efa 100644 --- a/app/Models/Component.php +++ b/app/Models/Component.php @@ -45,15 +45,9 @@ class Component extends Model implements HasPresenter 'group_id' => 'int', 'description' => 'string', 'link' => 'string', + 'deleted_at' => 'date', ]; - /** - * The attributes that should be mutated to dates. - * - * @var array - */ - protected $dates = ['deleted_at']; - /** * The fillable properties. * diff --git a/app/Models/Incident.php b/app/Models/Incident.php index 8b32f59e..dc15a14e 100644 --- a/app/Models/Incident.php +++ b/app/Models/Incident.php @@ -35,17 +35,12 @@ class Incident extends Model implements HasPresenter * @var string[] */ protected $casts = [ - 'id' => 'int', - 'visible' => 'integer', + 'id' => 'int', + 'visible' => 'int', + 'scheduled_at' => 'date', + 'deleted_at' => 'date', ]; - /** - * The attributes that should be mutated to dates. - * - * @var string[] - */ - protected $dates = ['scheduled_at', 'deleted_at']; - /** * The fillable properties. * diff --git a/app/Models/Subscriber.php b/app/Models/Subscriber.php index 8f5651de..bbd3030f 100644 --- a/app/Models/Subscriber.php +++ b/app/Models/Subscriber.php @@ -29,15 +29,9 @@ class Subscriber extends Model implements HasPresenter 'id' => 'int', 'email' => 'string', 'verify_code' => 'string', + 'verified_at' => 'date', ]; - /** - * The attributes that should be mutated to dates. - * - * @var array - */ - protected $dates = ['verified_at']; - /** * The fillable properties. *