PHP code example of oclock / twilio-messenger
1. Go to this page and download the library: Download oclock/twilio-messenger 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/ */
oclock / twilio-messenger example snippets
Oclock\TwilioMessenger\TwilioServiceProvider::class
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Oclock\TwilioMessenger\TwilioService;
class HomeController extends Controller
{
//
public function index(Request $request, TwilioService $twilio)
{
if($request->phonenumber && $request->message){
$media = 'Your media url';
$send = $twilio->sendWhatsapp($request->phonenumber, $request->message, $media);
}
}
}