Skip to content

Commit

Permalink
adding casts to automatically unserialize meta column
Browse files Browse the repository at this point in the history
  • Loading branch information
rizkyarlin authored and uyab committed Sep 21, 2019
1 parent ef82d40 commit e5f9c98
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Models/City.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ class City extends Model
{
protected $table = 'cities';

protected $casts = [
'meta' => 'array',
];

public $timestamps = false;

public function province()
Expand Down
4 changes: 4 additions & 0 deletions src/Models/District.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ class District extends Model
{
protected $table = 'districts';

protected $casts = [
'meta' => 'array',
];

public $timestamps = false;

public function city()
Expand Down
4 changes: 4 additions & 0 deletions src/Models/Province.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ class Province extends Model
{
protected $table = 'provinces';

protected $casts = [
'meta' => 'array',
];

public $timestamps = false;

public function cities()
Expand Down
4 changes: 4 additions & 0 deletions src/Models/Village.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ class Village extends Model
{
protected $table = 'villages';

protected $casts = [
'meta' => 'array',
];

public $timestamps = false;

public function district()
Expand Down

0 comments on commit e5f9c98

Please sign in to comment.