PHP code example of yhshanto / walletmix-sms-channel

1. Go to this page and download the library: Download yhshanto/walletmix-sms-channel 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/ */

    

yhshanto / walletmix-sms-channel example snippets


'walletmix' => [
  'sms' => [
    'username'  => env('WALLETMIX_SMS_USERNAME'),
    'password'  => env('WALLETMIX_SMS_PASSWORD'),
    'from' 	=> env('WALLETMIX_SMS_FROM') // SMS Mask
  ]
]

/**
 * Get the Walletmix / SMS representation of the notification.
 *
 * @param  mixed  $notifiable
 * @return WalletmixMessage
 */
public function toWalletmix($notifiable)
{
    return (new WalletmixMessage)
                ->content('Your SMS message content');
}

/**
 * Get the Walletmix / SMS representation of the notification.
 *
 * @param  mixed  $notifiable
 * @return WalletmixMessage
 */
public function toWalletmix($notifiable)
{
    return (new WalletmixMessage)
                ->content('Your unicode message')
                ->unicode();
}

/**
 * Get the Walletmix / SMS representation of the notification.
 *
 * @param  mixed  $notifiable
 * @return WalletmixMessage
 */
public function toWalletmix($notifiable)
{
    return (new WalletmixMessage)
                ->content('Your SMS message content')
                ->from('15554443333');
}



namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable;

    /**
     * Route notifications for the Walletmix channel.
     *
     * @param  \Illuminate\Notifications\Notification  $notification
     * @return string
     */
    public function routeNotificationForWalletmix($notification)
    {
        return $this->phone;
    }
}