Skip to content

Commit

Permalink
Add fallback type
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenlake committed Apr 5, 2019
1 parent 63110b0 commit 6db1696
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Models/Property.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function setKeyAttribute($value)
*/
public function setDefaultAttribute($value)
{
switch ($this->attributes['type']) {
switch ($this->attributes['type'] ?? 'JSON') {
case 'JSON':
$this->attributes['default'] = json_encode($value);
break;
Expand Down Expand Up @@ -140,7 +140,7 @@ public function setTypeAttribute($value)
*/
public function getDefaultAttribute($value)
{
switch ($this->attributes['type']) {
switch ($this->attributes['type'] ?? 'JSON') {
case 'JSON':
$value = !is_array($value) ? json_decode($value) : $value;
break;
Expand Down

0 comments on commit 6db1696

Please sign in to comment.