PHP code example of tipytechnique / laravel-ovh-sms
1. Go to this page and download the library: Download tipytechnique/laravel-ovh-sms 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/ */
php
// Using depency injection
use Illuminate\Routing\Controller as BaseController;
use TipyTechnique\LaravelOvhSms\Contracts\Sms;
class SmsController extends BaseController
{
/**
* Get all outgoing messages
*
* @param Sms $sms
*
* @return array
*/
public function getAllSms(Sms $sms): array
{
return $sms->getMessages('incoming');
}
}
php
// Using Facade
use Illuminate\Routing\Controller as BaseController;
use TipyTechnique\LaravelOvhSms\Facades\Sms;
class SmsController extends BaseController
{
/**
* Get all outgoing messages
*
* @param Sms $sms
*
* @return array
*/
public function getAllSms(Sms $sms): array
{
return Sms::getMessages('incoming');
}
}
php
// get all blacklisted numbers
$blasklisted = Sms::getBlacklistedNumbers(); // array
// remove a given number from the blacklist
Sms::removeBlacklistedNumber('+33654632544');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.