| 
									
										
										
										
											2020-06-11 13:42:35 +00:00
										 |  |  | <?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 | 
					
						
							| 
									
										
										
										
											2020-06-20 15:08:13 +00:00
										 |  |  |  * @property Collection|WalletIlinkTransaction[] $wallet_ilink_transactions | 
					
						
							| 
									
										
										
										
											2020-06-11 13:42:35 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * @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() | 
					
						
							|  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2020-06-20 15:08:13 +00:00
										 |  |  | 		return $this->hasMany(Identification::class); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	public function wallet_ilink_transactions() | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		return $this->hasMany(WalletIlinkTransaction::class, 'final_country'); | 
					
						
							| 
									
										
										
										
											2020-06-11 13:42:35 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | } |