Skip to content

Event Listener - Balance times 2 #951

Answered by rez1dent3
lucastbucks asked this question in Q&A
Discussion options

You must be logged in to vote

@lucastbucks You need to get your balance like this:

final class WalletUpdatedEvent implements BalanceUpdatedEventInterface, ShouldBroadcastNow
{
    use Dispatchable, InteractsWithSockets, SerializesModels;
....
    public function getBalance(): string {
-        return $this->wallet->balance;
+        return $this->wallet->getOriginalBalanceAttribute();
    }
    ....

I think this will solve your problem. Please write the result.

From source:

public function create(Wallet $wallet): BalanceUpdatedEventInterface
{
return new BalanceUpdatedEvent(
$wallet->getKey(),

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@lucastbucks
Comment options

@rez1dent3
Comment options

@lucastbucks
Comment options

@rez1dent3
Comment options

Answer selected by lucastbucks
@lucastbucks
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants