70 lines
1.2 KiB
PHP
70 lines
1.2 KiB
PHP
|
<?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
|
||
|
*
|
||
|
* @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, 'country');
|
||
|
}
|
||
|
}
|