halilcosdu / laravel-signalwire
Laravel SignalWire - Send Fax From Laravel
Fund package maintenance!
Buy Me A Coffee
Requires
- php: ^8.2
- illuminate/contracts: ^10.0||^11.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.3
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- spatie/laravel-ray: ^1.35
README
Send Fax From Laravel package provides a Laravel-friendly interface for interacting with the SignalWire API, a cloud communication platform that offers services like voice, messaging, and video.
The package offers a variety of methods to interact with different aspects of the SignalWire services:
-
Fax Operations: You can send, receive, update, and delete faxes. This includes methods like
faxes
,sendFax
,getFax
,updateFax
, anddeleteFax
. -
Phone Numbers: You can list, create, update, and delete incoming phone numbers. This includes methods like
listIncomingPhoneNumbers
,createIncomingPhoneNumber
,getIncomingPhoneNumber
,updateIncomingPhoneNumber
,deleteIncomingPhoneNumber
, andgetAvailablePhoneNumbers
. -
Fax Media: You can manage media related to faxes. This includes methods like
faxMedias
,getFaxMedia
, anddeleteFaxMedia
.
The package uses the Facade pattern, which means you can access all these methods statically via the SignalWire
facade. This makes it easy to use the SignalWire services in your Laravel application.
Installation
You can install the package via composer:
composer require halilcosdu/laravel-signalwire
You can publish the config file with:
php artisan vendor:publish --tag="signalwire-config"
This is the contents of the published config file:
return [ 'project_id' => env('SIGNALWIRE_PROJECT_ID'), 'token' => env('SIGNALWIRE_TOKEN'), 'space_url' => env('SIGNALWIRE_SPACE_URL'), 'incoming_phone_number_status_callback_url' => env('SIGNALWIRE_INCOMING_PHONE_NUMBER_STATUS_CALLBACK_URL'), //create or update IncomingPhoneNumbers 'incoming_phone_number_voice_url' => env('SIGNALWIRE_INCOMING_PHONE_NUMBER_VOICE_URL'),// create or update IncomingPhoneNumbers ];
Usage
use HalilCosdu\SignalWire\Facades\SignalWire; // Fax Operations SignalWire::faxes(?string $dateCreateAfter = null, ?string $dateCreatedOnOrBefore = null, ?string $from = null, ?string $to = null) SignalWire::sendFax(string $mediaUrl, string $to, string $from, ?string $statusCallback = null, string $quality = 'standard') SignalWire::getFax(string $sid) SignalWire::updateFax(string $sid, string $status) SignalWire::deleteFax(string $sid) // Phone Number Operations SignalWire::listIncomingPhoneNumbers(?string $beta = null, ?string $friendlyName = null, ?string $origin = null, ?string $phoneNumber = null) SignalWire::createIncomingPhoneNumber(string $areaCode, string $phoneNumber, ?string $addressSid = null, ?string $friendlyName = null, ?string $identitySid = null, ?string $smsApplicationSid = null, ?string $smsFallbackMethod = null, ?string $smsFallbackUrl = null, ?string $smsMethod = null, ?string $smsUrl = null, ?string $statusCallback = null, ?string $statusCallbackMethod = null, ?string $trunkSid = null, ?string $voiceApplicationSid = null, bool $voiceCallerIdLookup = false, ?string $voiceFallbackMethod = null, ?string $voiceFallbackUrl = null, ?string $voiceMethod = null, string $voiceReceiveMode = 'fax', ?string $voiceUrl = null) SignalWire::getIncomingPhoneNumber(string $phoneNumberSid) SignalWire::updateIncomingPhoneNumber(string $phoneNumberSid, string $friendlyName, string $smsUrl, string $smsMethod, string $voiceUrl, string $voiceMethod) SignalWire::deleteIncomingPhoneNumber(string $phoneNumberSid) // Available Numbers to Buy SignalWire::getAvailablePhoneNumbers(string $isoCountry, ?string $areaCode, bool $beta = false, ?string $contains = null, bool $excludeAllAddressRequired = false, bool $excludeLocalAddressRequired = false, bool $faxEnabled = false, string $inRegion = null, bool $mmsEnabled = false, bool $voiceEnabled = false) // Fax Media SignalWire::faxMedias(string $faxSid) SignalWire::getFaxMedia(string $faxSid, string $mediaSid) SignalWire::deleteFaxMedia(string $faxSid, string $mediaSid)
Example
use HalilCosdu\SignalWire\Facades\SignalWire; // Send Fax SignalWire::sendFax('https://www.example.com/fax.pdf', '+1234567890', '+0987654321', 'https://www.example.com/fax-status-callback', 'standard');
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.