PHP code example of niisan / laravel-sms-notification

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

    

niisan / laravel-sms-notification example snippets


    public function via($notifiable)
    {
        return ['sms'];
    }

    public function toSms($notifiable)
    {
        return (new SmsMessage)
                ->body('hello world! ' . $notifiable->name);
    }

    public function routeNotificationForSms()
    {
        return $this->phone_number;
    }

    public function toSms($notifiable)
    {
        return (new SmsMessage)
                ->body('hello world! ' . $notifiable->name)
                ->to('+2222333344')
                ->from('+1111222233');
    }

    public function toSms($notifiable)
    {
        return (new SmsMessage)
                ->body('hello world! ' . $notifiable->name)
                ->unicode();
    }

php artisan vendor:publish --provider "Niisan\Notification\SmsNotificationServiceProvider"