Conversation
|
Good PR! The only thing I am missing is that in my case the data is also different per event. Maybe you could pass the event name in the {
"time_ms": 1697717045179,
"events": [
{
"name": "channel_occupied",
"channel": "admin",
"data": {} <---
},
{
"name": "member_added",
"channel": "admin",
"data": {} <---
}
]
}public function getData(Request $request, string $event): array
{
return $request->collect('events')
->filter(fn($item) => $item['name'] === $event)
->map(fn($item) => $item['data'])
->toArray();
} |
|
@jeffreyvanhees Did you grab the latest version? Maybe run |
|
@jeffreyvanhees Here's the README change in the PR to show you how: |
|
As far as I know I have the latest version. ( I get the error receiver/src/AbstractWebhook.php Line 79 in 2a6893c Also, can you give an example how to use the Note: in the new example you'd add to the readme, you use $this->request instead of the $request-argument. Is there a reason for that? |
This PR adds support for handling multiple events in a single payload.
The
getEventmethod has been updated to support the return of either astringorarrayvalue, and thehandlemethod updated accordingly.Resolves #13