PHP code example of laravel-notification-channels / cmsms

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

    

laravel-notification-channels / cmsms example snippets


// config/app.php
'providers' => [
    ...
    NotificationChannels\Cmsms\CmsmsServiceProvider::class,
],

// config/services.php
...
'cmsms' => [
    'product_token' => env('CMSMS_PRODUCT_TOKEN'),
    'originator' => env('CMSMS_ORIGINATOR'),
],
...

public function routeNotificationForCmsms()
{
    return '0031612345678';
}
 php
use NotificationChannels\Cmsms\CmsmsMessage;
use Illuminate\Notifications\Notification;

class VpsServerOrdered extends Notification
{
    public function via($notifiable)
    {
        return ['cmsms'];
    }

    public function toCmsms($notifiable)
    {
        return CmsmsMessage::create("Your {$notifiable->service} was ordered!");
    }
}