61 lines
1.0 KiB
PHP
Executable File
61 lines
1.0 KiB
PHP
Executable File
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class Wallet
|
|
*
|
|
* @property int $id
|
|
* @property float $balance_princ
|
|
* @property float $balance_com
|
|
* @property int $id_networkAgent
|
|
* @property Carbon $created_date
|
|
*
|
|
* @property NetworksAgent $networks_agent
|
|
* @property Collection|WalletTransaction[] $wallet_transactions
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class Wallet extends Model
|
|
{
|
|
protected $table = 'wallets';
|
|
public $timestamps = false;
|
|
|
|
protected $casts = [
|
|
'balance_princ' => 'float',
|
|
'balance_com' => 'float',
|
|
'id_networkAgent' => 'int'
|
|
];
|
|
|
|
protected $dates = [
|
|
'created_date'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'balance_princ',
|
|
'balance_com',
|
|
'id_networkAgent',
|
|
'created_date'
|
|
];
|
|
|
|
public function networks_agent()
|
|
{
|
|
return $this->belongsTo(NetworksAgent::class, 'id_networkAgent');
|
|
}
|
|
|
|
public function wallet_transactions()
|
|
{
|
|
return $this->hasMany(WalletTransaction::class, 'id_wallet');
|
|
}
|
|
|
|
|
|
}
|