From 9fc1cbd7aec9c6cf32a4e4716822c9fbe4915ab7 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 31 Oct 2023 12:24:48 +0000 Subject: [PATCH] Change cast to include format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://laravel.com/docs/8.x/eloquent-mutators#date-casting - this doesn’t seem to work tho? Signed-off-by: snipe --- app/Models/License.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Models/License.php b/app/Models/License.php index 44f1f45b70..ba00b7d0d4 100755 --- a/app/Models/License.php +++ b/app/Models/License.php @@ -32,10 +32,11 @@ class License extends Depreciable protected $guarded = 'id'; protected $table = 'licenses'; + protected $casts = [ - 'purchase_date' => 'date', - 'expiration_date' => 'date', - 'termination_date' => 'date', + 'purchase_date' => 'date:Y-m-d', + 'expiration_date' => 'date:Y-m-d', + 'termination_date' => 'date:Y-m-d', 'category_id' => 'integer', 'company_id' => 'integer', ];