Catch-all broadcast authorization callbacks #46325
-
We used to have the following authorization callback defined in in Broadcast::channel('{key}', function (User $user) {
if (! $user->isAdmin()) {
return false;
}
return [
'id' => $user->id,
'name' => $user->name,
];
}); The Back in October, Taylor merged a PR that made the matching Are there any alternatives to achieve the same without extending overriding the I'd love to be able to define a default auth check without having to override a class from vendor. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hello @sebastiandedeyne , Did you find a solution ? |
Beta Was this translation helpful? Give feedback.
-
@sebastiandedeyne I can't find a proper preg escaping in the Broadcaster implementation, so try to use '{key}.*' as a channel name. Would it work - fill free to fill the bug report. |
Beta Was this translation helpful? Give feedback.
@sebastiandedeyne I can't find a proper preg escaping in the Broadcaster implementation, so try to use '{key}.*' as a channel name. Would it work - fill free to fill the bug report.