I am trying to make the configuration for Pusher in my Laravel app (SaaS) dynamic. Basically I want to store different Pusher configs for different accounts. And call the corresponding config based on the user.
I have tries to change the config in runtime using config()->set('services.pusher.xxx', 'yyyy')
, but this doesn't work at any level of the framework, event in a custom ServiceProvider.
I found Laravel's BroadcastManager
and tried to override the createPusherDriver()
so that I could create a custom instance of PusherBroadcaster
with the user's config, but I am not sure how to do that or where to put it!
What is the best-practice/standard way to do that?