| 
									
										
										
										
											2020-06-01 18:31:25 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Created by Reliese Model. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace App\Models; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | use Carbon\Carbon; | 
					
						
							| 
									
										
										
										
											2020-06-19 13:48:27 +00:00
										 |  |  | use Illuminate\Database\Eloquent\Collection; | 
					
						
							| 
									
										
										
										
											2020-06-01 18:31:25 +00:00
										 |  |  | use Illuminate\Database\Eloquent\Model; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Class WalletsUser | 
					
						
							|  |  |  |  *  | 
					
						
							|  |  |  |  * @property int $id | 
					
						
							|  |  |  |  * @property float $balance | 
					
						
							|  |  |  |  * @property Carbon $createdAt | 
					
						
							|  |  |  |  * @property int $idUser | 
					
						
							|  |  |  |  *  | 
					
						
							|  |  |  |  * @property User $user | 
					
						
							| 
									
										
										
										
											2020-06-19 13:48:27 +00:00
										 |  |  |  * @property Collection|WalletIlinkTransaction[] $wallet_ilink_transactions | 
					
						
							| 
									
										
										
										
											2020-06-01 18:31:25 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * @package App\Models | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | class WalletsUser extends Model | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	protected $table = 'wallets_users'; | 
					
						
							|  |  |  | 	public $timestamps = false; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	protected $casts = [ | 
					
						
							|  |  |  | 		'balance' => 'float', | 
					
						
							|  |  |  | 		'idUser' => 'int' | 
					
						
							|  |  |  | 	]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	protected $dates = [ | 
					
						
							|  |  |  | 		'createdAt' | 
					
						
							|  |  |  | 	]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	protected $fillable = [ | 
					
						
							|  |  |  | 		'balance', | 
					
						
							|  |  |  | 		'createdAt', | 
					
						
							|  |  |  | 		'idUser' | 
					
						
							|  |  |  | 	]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	public function user() | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		return $this->belongsTo(User::class, 'idUser'); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2020-06-19 13:48:27 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	public function wallet_ilink_transactions() | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		return $this->hasMany(WalletIlinkTransaction::class, 'id_wallet_user'); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2020-06-01 18:31:25 +00:00
										 |  |  | } |