PHP code example of halilcosdu / laravel-signalwire
1. Go to this page and download the library: Download halilcosdu/laravel-signalwire library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
halilcosdu / laravel-signalwire example snippets
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
];
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)
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');
bash
php artisan vendor:publish --tag="signalwire-config"