PHP code example of gabeta / laravel-custom-sms-channels

1. Go to this page and download the library: Download gabeta/laravel-custom-sms-channels 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/ */

    

gabeta / laravel-custom-sms-channels example snippets


'default' => env('CUSTOM_SMS_CHANNEL', 'sms_log'),

'preview' => [
    'enable' => env('ENABLE_SMS_PREVIEW', true),

    'domain' => null,

    'path' => '/customs-sms-dashboard',
],

'providers' => [

    'sms_log' => [
        'config' => [
            'driver' => 'single',
            'path' => storage_path('logs/custom-sms.log'),
            'level' => 'info',
        ],
    ],

    'infobip' => [
        'send_from' => env('INFOBIP_SEND_FROM'),

        'api_host' => env('INFOBIP_API_HOST'),

        'api_key_prefix' => env('INFOBIP_API_KEY_PREFIX'),

        'api_key' => env('INFOBIP_API_KEY'),
    ]

    ....
]


'providers' => [
    'vonage' => null
]
bash
php artisan vendor:publish --provider="Gabeta\CustomSmsChannels\CustomSmsChannelsServiceProvider" --tag="config"
 php
use Illuminate\Notifications\Notification;

class WelcomeNotification extends Notification
{
    public function via($notifiable)
    {
        return ['customsms'];
    }
    
    public function toCustomSms($notifiable)
    {
        return "Hello Laravel Community from Ivory Coast (Côte D'ivoire)";
    }
}
 php
use Gabeta\CustomSmsChannels\Facades\PhoneNumber;

public function routeNotificationForCustomSms()
{
    return PhoneNumber::setDialCode($this->dial_code)
                ->setPhone($this->phone);
}
 php
use Gabeta\CustomSmsChannels\Facades\PhoneNumber;

public function routeNotificationForCustomSms()
{
    return PhoneNumber::setRouteNotification($this->full_phone_number);
}
bash
php artisan vendor:publish --provider="Gabeta\CustomSmsChannels\CustomSmsChannelsServiceProvider" --tag="public"