81 lines
1.6 KiB
PHP
Executable File
81 lines
1.6 KiB
PHP
Executable File
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class Country
|
|
*
|
|
* @property int $id
|
|
* @property string $code_dial
|
|
* @property string $name
|
|
* @property string $code_country
|
|
* @property float $longitude
|
|
* @property float $latitude
|
|
* @property int $idCurrency
|
|
*
|
|
* @property Currency $currency
|
|
* @property Collection|Admin[] $admins
|
|
* @property Collection|ConfigGame[] $config_games
|
|
* @property Collection|Identification[] $identifications
|
|
* @property Collection|WalletIlinkTransaction[] $wallet_ilink_transactions
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class Country extends Model
|
|
{
|
|
protected $table = 'countries';
|
|
public $timestamps = false;
|
|
|
|
protected $casts = [
|
|
'longitude' => 'float',
|
|
'latitude' => 'float',
|
|
'idCurrency' => 'int'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'code_dial',
|
|
'name',
|
|
'code_country',
|
|
'longitude',
|
|
'latitude',
|
|
'idCurrency'
|
|
];
|
|
|
|
public function currency()
|
|
{
|
|
return $this->belongsTo(Currency::class, 'idCurrency');
|
|
}
|
|
|
|
public function admins()
|
|
{
|
|
return $this->hasMany(Admin::class, 'country');
|
|
}
|
|
|
|
public function config_games()
|
|
{
|
|
return $this->hasMany(ConfigGame::class, 'id_pays');
|
|
}
|
|
|
|
public function identifications()
|
|
{
|
|
return $this->hasMany(Identification::class);
|
|
}
|
|
|
|
public function wallet_ilink_transactions()
|
|
{
|
|
return $this->hasMany(WalletIlinkTransaction::class, 'final_country');
|
|
}
|
|
|
|
public function regulation()
|
|
{
|
|
return $this->belongsTo(Regulation::class, 'id_country');
|
|
}
|
|
}
|