PHP code example of codebar-ag / laravel-twilio-verify
1. Go to this page and download the library: Download codebar-ag/laravel-twilio-verify 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/ */
codebar-ag / laravel-twilio-verify example snippets
use CodebarAg\TwilioVerify\Facades\TwilioVerify;
/**
* Start a new SMS verification to the phone number.
*/
$verificationStart = TwilioVerify::start(to: '+12085059915');
/**
* Check a verification code.
*/
$verificationCheck = TwilioVerify::check(to: '+12085059915', code: '1337');
return [
/*
|--------------------------------------------------------------------------
| Twilio Verify Configuration
|--------------------------------------------------------------------------
|
| You can find your Account SID and Auth Token in the Console Dashboard.
| Additionally you should create a new Verify service and paste it in
| here. Afterwards you are ready to communicate with Twilio Verify.
|
*/
'url' => env('TWILIO_URL', 'https://verify.twilio.com/v2/Services'),
'account_sid' => env('TWILIO_ACCOUNT_SID', 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'),
'auth_token' => env('TWILIO_AUTH_TOKEN', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'),
'service_sid' => env('TWILIO_SERVICE_SID', 'VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'),
];
use CodebarAg\TwilioVerify\Events\TwilioVerifyResponseLog;
// Log each response from the Twilio REST API.
TwilioVerifyResponseLog::class => [
//
],