walletserviceExterne/app/Models/Network.php

65 lines
1.2 KiB
PHP
Executable File

<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class Network
*
* @property int $id
* @property int $country_id
* @property string $name
* @property int $id_networkAgent
* @property int $status
*
* @property Collection|ConfigWallet[] $config_wallets
* @property Collection|Identification[] $identifications
* @property WalletsPassword $wallets_password
*
* @package App\Models
*/
class Network extends Model
{
protected $table = 'networks';
public $timestamps = false;
protected $casts = [
'country_id' => 'int',
'id_networkAgent' => 'int',
'status' => 'int'
];
protected $fillable = [
'country_id',
'name',
'id_networkAgent',
'status'
];
public function config_wallets()
{
return $this->hasMany(ConfigWallet::class, 'id_network');
}
public function identifications()
{
return $this->hasMany(Identification::class, 'idNetwork');
}
public function wallets_password()
{
return $this->hasOne(WalletsPassword::class);
}
public function country()
{
return $this->belongsTo(Country::class, 'country_id');
}
}