'date', 'verified_at' => 'datetime', ]; public function user() { return $this->belongsTo(User::class); } public function withdraws() { return $this->hasMany(AffiliatorWithdraw::class); } public function feeLedgers() { return $this->hasMany(AffiliatorFeeLedger::class); } public function getBalanceAttribute() : float { return $this->feeLedgers()->sum('amount'); } public function routeNotificationForEmail() { $email = $this->email; return $email; } }