Skip to content

Commit be22678

Browse files
committed
update docs
1 parent b190696 commit be22678

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

docs/_sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
- Events
3838

3939
- [BalanceUpdatedEvent](balance-updated-event)
40+
- [WalletCreatedEvent](wallet-created-event)
4041
- [Event Customize](event-customize)
4142

4243
- Additions

docs/wallet-created-event.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## Tracking the creation of wallets
2+
3+
The events are similar to the events for updating the balance, only for the creation of a wallet. A frequent case of transferring data via websockets to the front-end.
4+
5+
Version 7.3 introduces an interface to which you can subscribe.
6+
This is done using standard Laravel methods.
7+
More information in the [documentation](https://laravel.com/docs/8.x/events).
8+
9+
```php
10+
use Bavix\Wallet\Internal\Events\WalletCreatedEventInterface;
11+
12+
protected $listen = [
13+
WalletCreatedEventInterface::class => [
14+
MyWalletCreatedListener::class,
15+
],
16+
];
17+
```
18+
19+
And then we create a listener.
20+
21+
```php
22+
use Bavix\Wallet\Internal\Events\WalletCreatedEventInterface;
23+
24+
class MyWalletCreatedListener
25+
{
26+
public function handle(WalletCreatedEventInterface $event): void
27+
{
28+
// And then the implementation...
29+
}
30+
}
31+
```
32+
33+
It worked!

0 commit comments

Comments
 (0)