| 
									
										
										
										
											2021-10-19 14:35:01 +00:00
										 |  |  | <?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 | 
					
						
							|  |  |  |  * @package App\Models | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | class Network extends Model | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     public $timestamps = false; | 
					
						
							|  |  |  |     protected $table = 'networks'; | 
					
						
							|  |  |  |     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 country() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return $this->belongsTo(CountriesCurrency::class, 'country_id'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2022-01-25 23:16:26 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function nh_network_config() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return $this->hasOne(NhNetworksConfig::class, 'network_id'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-10-19 14:35:01 +00:00
										 |  |  | } |