If you want to troll your friends with this, here you go. Caution, if used in a live demo, may have unexpected results.
Super Importaint Note: The get()
method used here is basically a prototype, so it certianly may change. /warning
Add this to composer.json
, to bring in both the Nexmo client and Laravel package as their currently in beta:
"nexmo/laravel": "dev-master as 1.0",
"nexmo/client": "dev-master as 1.0"
Add the Nexmo Service Provider to your app.php
config:
'providers' => [
Nexmo\Laravel\NexmoServiceProvider::class
]
And to aliases
if you want to use the facade:
'aliases' => [
'Nexmo' => Nexmo\Laravel\Facade\Nexmo::class
]
Remove the CSRF middleware in Kernal.php
to allow the inbound POST
webhook from Nexmo:
'web' => [
//\App\Http\Middleware\VerifyCsrfToken::class,
],
And update routes.php with the blissfully simplistic code you find here.
Create an account, if you don't have one already. And configure an inbound number to point to you app. Might need to use ngrok to accept outside requests.