diff --git a/app/Group.php b/app/Group.php index 8fa84408..efe2ec02 100644 --- a/app/Group.php +++ b/app/Group.php @@ -32,6 +32,16 @@ class Group extends Model protected $hidden = ['created_at', 'updated_at']; + /** + * The attributes that should be cast. + * + * @var array + */ + protected $casts = [ + 'twofaccounts_count' => 'integer', + ]; + + /** * Get the TwoFAccounts of the group. */ diff --git a/app/TwoFAccount.php b/app/TwoFAccount.php index e21e73e0..67043098 100644 --- a/app/TwoFAccount.php +++ b/app/TwoFAccount.php @@ -52,6 +52,17 @@ class TwoFAccount extends Model implements Sortable protected $hidden = ['token', 'uri', 'secret', 'algorithm', 'created_at', 'updated_at']; + /** + * The attributes that should be cast. + * + * @var array + */ + protected $casts = [ + 'group_id' => 'integer', + 'order_column' => 'integer', + ]; + + /** * An OTP object from package Spomky-Labs/otphp *