Cast model attributes that should be integer

This commit is contained in:
Bubka 2020-11-23 12:54:06 +01:00
parent d571d6a429
commit 13dc8b75e5
2 changed files with 21 additions and 0 deletions

View File

@ -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.
*/

View File

@ -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
*