PHP Classes

File: src/Helpers/helpers.php

Recommend this page to a friend!
  Classes of Zacchaeus Bolaji   Laravel PHP SMS API Integration   src/Helpers/helpers.php   Download  
File: src/Helpers/helpers.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Laravel PHP SMS API Integration
Abstraction to send SMS messages via multiple APIs
Author: By
Last change:
Date: 4 years ago
Size: 363 bytes
 

Contents

Class file image Download
<?php

if (! function_exists('send_sms')) {
    function
send_sms(string $message, string $to, $from = null, string $class = null)
    {
       
$class = $class ? $class : config('laravel-sms.default');
       
$sms = new $class($message);
       
$sms->to($to);
        if (
$from) {
           
$sms->from($from);
        }

        return
$sms->send();
    }
}