Convert deprecated $dates property to $casts

This commit is contained in:
Shift 2023-01-05 17:02:42 +00:00
parent 8f4908b1b7
commit e947abcab2
No known key found for this signature in database
GPG key ID: 5A96F038425C5A1C
3 changed files with 7 additions and 11 deletions

View file

@ -15,8 +15,9 @@ class ApplicationApi extends Model
protected $primaryKey = 'token'; protected $primaryKey = 'token';
public $incrementing = false; public $incrementing = false;
protected $casts = [
protected $dates = ['last_used']; 'last_used' => 'datetime',
];
public static function boot() public static function boot()
{ {

View file

@ -51,8 +51,8 @@ class Server extends Model
/** /**
* @var string[] * @var string[]
*/ */
protected $dates = [ protected $casts = [
'suspended', 'suspended' => 'datetime',
]; ];
public static function boot() public static function boot()

View file

@ -25,20 +25,15 @@ class Voucher extends Model
'uses', 'uses',
'expires_at', 'expires_at',
]; ];
protected $dates = [
'expires_at',
];
/** /**
* The attributes that should be cast to native types. * The attributes that should be cast to native types.
* *
* @var array * @var array
*/ */
protected $casts = [ protected $casts = [
'expires_at' => 'datetime',
'credits' => 'float', 'credits' => 'float',
'uses' => 'integer', 'uses' => 'integer', ];
];
protected $appends = ['used', 'status']; protected $appends = ['used', 'status'];