| 
									
										
										
										
											2020-04-15 23:08:09 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Created by Reliese Model. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace App\Models; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | use Illuminate\Database\Eloquent\Collection; | 
					
						
							|  |  |  | use Illuminate\Database\Eloquent\Model; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Class NetworksAgent | 
					
						
							| 
									
										
										
										
											2020-07-02 19:18:28 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2020-04-15 23:08:09 +00:00
										 |  |  |  * @property int $id | 
					
						
							|  |  |  |  * @property int $network_id | 
					
						
							|  |  |  |  * @property int $agent_id | 
					
						
							|  |  |  |  * @property float $solde | 
					
						
							|  |  |  |  * @property int $etat | 
					
						
							|  |  |  |  * @property int $codeGenerer_id | 
					
						
							|  |  |  |  * @property string $phone | 
					
						
							|  |  |  |  * @property string $transactionNumber | 
					
						
							|  |  |  |  * @property string $validation_code | 
					
						
							| 
									
										
										
										
											2020-07-02 19:18:28 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2020-04-15 23:08:09 +00:00
										 |  |  |  * @property Collection|Wallet[] $wallets | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @package App\Models | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | class NetworksAgent extends Model | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	protected $table = 'networks_agents'; | 
					
						
							|  |  |  | 	public $timestamps = false; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	protected $casts = [ | 
					
						
							|  |  |  | 		'network_id' => 'int', | 
					
						
							|  |  |  | 		'agent_id' => 'int', | 
					
						
							|  |  |  | 		'solde' => 'float', | 
					
						
							|  |  |  | 		'etat' => 'int', | 
					
						
							|  |  |  | 		'codeGenerer_id' => 'int' | 
					
						
							|  |  |  | 	]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	protected $fillable = [ | 
					
						
							|  |  |  | 		'network_id', | 
					
						
							|  |  |  | 		'agent_id', | 
					
						
							|  |  |  | 		'solde', | 
					
						
							|  |  |  | 		'etat', | 
					
						
							|  |  |  | 		'codeGenerer_id', | 
					
						
							|  |  |  | 		'phone', | 
					
						
							|  |  |  | 		'transactionNumber', | 
					
						
							|  |  |  | 		'validation_code' | 
					
						
							|  |  |  | 	]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	public function wallets() | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		return $this->hasMany(Wallet::class, 'id_networkAgent'); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2020-07-02 19:18:28 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function network() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return $this->belongsTo(Network::class, 'network_id'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2020-04-15 23:08:09 +00:00
										 |  |  | } |