0
votes

I'm having a hard time sorting out how to make Nexmo use custom settings from $notifiable i.e. App\User while sending out notifications. Laravel by default expects the Nexmo config (API key, secret) to be set in services.php and Nexmo driver uses the config from there directly. Although updating the config in runtime helps setting the values for the first time (if not set in services.php) but the same config values are used for all events. Ideally the config values should be used directly from the notifiable.

1

1 Answers

1
votes

If I've understood the question correctly, you want to use your customer's API key and secret rather than using a single value for all customers.

If you'd like to use multiple API keys and secrets you'll need to use nexmo/client directly (github repo):

$client = new Nexmo\Client(new Nexmo\Client\Credentials\Basic(API_KEY, API_SECRET));

You can fetch the credentials from the database and add the client instance to the container by writing your own small service provider. Here's the one that nexmo/laravel uses. This one is complicated as it has to support every possible authentication combination.

/via https://github.com/Nexmo/nexmo-laravel/issues/27