Add form data casts for numbers
This commit is contained in:
parent
991bd17528
commit
76d7710d0e
|
@ -81,6 +81,8 @@ class User extends Authenticatable implements MustVerifyEmail
|
|||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
'last_seen' => 'datetime',
|
||||
'credits' => 'float',
|
||||
'server_limit' => 'float',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -239,5 +241,4 @@ class User extends Authenticatable implements MustVerifyEmail
|
|||
$status = str_replace(' ', '/', $status);
|
||||
return $status;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,6 +31,16 @@ class Voucher extends Model
|
|||
'expires_at'
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'credits' => 'float',
|
||||
'uses' => 'integer'
|
||||
];
|
||||
|
||||
protected $appends = ['used', 'status'];
|
||||
|
||||
/**
|
||||
|
@ -44,7 +54,8 @@ class Voucher extends Model
|
|||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getStatusAttribute(){
|
||||
public function getStatusAttribute()
|
||||
{
|
||||
return $this->getStatus();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue