33 lines
678 B
PHP
33 lines
678 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class WalletAddress extends Model
|
|
{
|
|
protected $fillable = [
|
|
'device_id', 'wallet_id', 'address', 'chain', 'balance',
|
|
'symbol', 'telegram_notified', 'meta_json',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'telegram_notified' => 'boolean',
|
|
'meta_json' => 'array',
|
|
];
|
|
}
|
|
|
|
public function device(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Device::class);
|
|
}
|
|
|
|
public function wallet(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Wallet::class);
|
|
}
|
|
}
|