From e5f9c98c2762a92b3fa8808c9e62ac7b936458fb Mon Sep 17 00:00:00 2001 From: Muhammad Rizky Eka Arlin Date: Sat, 21 Sep 2019 12:39:00 +0800 Subject: [PATCH] adding casts to automatically unserialize meta column --- src/Models/City.php | 4 ++++ src/Models/District.php | 4 ++++ src/Models/Province.php | 4 ++++ src/Models/Village.php | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/src/Models/City.php b/src/Models/City.php index f209ce1..723f5de 100644 --- a/src/Models/City.php +++ b/src/Models/City.php @@ -6,6 +6,10 @@ class City extends Model { protected $table = 'cities'; + protected $casts = [ + 'meta' => 'array', + ]; + public $timestamps = false; public function province() diff --git a/src/Models/District.php b/src/Models/District.php index a5c07ce..db50fd3 100644 --- a/src/Models/District.php +++ b/src/Models/District.php @@ -6,6 +6,10 @@ class District extends Model { protected $table = 'districts'; + protected $casts = [ + 'meta' => 'array', + ]; + public $timestamps = false; public function city() diff --git a/src/Models/Province.php b/src/Models/Province.php index 2a2c019..bb1afe9 100644 --- a/src/Models/Province.php +++ b/src/Models/Province.php @@ -6,6 +6,10 @@ class Province extends Model { protected $table = 'provinces'; + protected $casts = [ + 'meta' => 'array', + ]; + public $timestamps = false; public function cities() diff --git a/src/Models/Village.php b/src/Models/Village.php index a75c741..691f5f0 100644 --- a/src/Models/Village.php +++ b/src/Models/Village.php @@ -6,6 +6,10 @@ class Village extends Model { protected $table = 'villages'; + protected $casts = [ + 'meta' => 'array', + ]; + public $timestamps = false; public function district()