Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Twilio now supports sending TwiML along with the initial request to create a call, rather than needing an external url to fetch TwiML from. It would be nice to support this alongside the existing url() method.
https://www.twilio.com/docs/voice/tutorials/how-to-make-outbound-phone-calls-php
Example use case:
You have a system which you want to be able to send a text-based notification to a phone.
i.e.
call a phone -> read out a message -> then hang up
.This can now be achieved by sending the message directly from the laravel notification, the same way you would a SMS, instead of also needing to handle urls and routing. It leaves open the whole TwiML flexibilty for more complex call chains by accepting an instance of VoiceResponse.
Previously this would be difficult for a system which didn't allow incoming network requests from the net, especially those behind a firewall, since you potentially need an entirely different system would need to handle the TwiML url responses.
Tests
I've been struggling to get the existing unit tests to pass
Error: Class 'Orchestra\Testbench\TestCase' not found
(I have runcomposer install
. Will add new ones when I get past this. EDIT: So it seems github-actions doesn't get that message, so must be something on my local box. I'll take another go at it over the weekend. Any thoughts still appreciated! :)I've opened this PR to get comments while I finish it off. There are several ways it could be implemented & happy to adjust to your style if that's preferred.