PHPackages                             yhshanto/walletmix-sms-channel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. yhshanto/walletmix-sms-channel

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

yhshanto/walletmix-sms-channel
==============================

Walletmix Notification Channel for laravel.

1.1(6y ago)110MITPHP

Since May 5Pushed 6y agoCompare

[ Source](https://github.com/yousuf-hossain-shanto/walletmix-sms-channel)[ Packagist](https://packagist.org/packages/yhshanto/walletmix-sms-channel)[ RSS](/packages/yhshanto-walletmix-sms-channel/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Walletmix Sms Channel
=====================

[](#walletmix-sms-channel)

#### Prerequisites

[](#prerequisites)

Before start, you must know about Laravel Notifications. You can check here..

Before you can send notifications via **Walletmix**, you need to install the **yhshanto/walletmix-sms-channel** Composer package:

```
composer require yhshanto/walletmix-sms-channel

```

Next, you will need to add a few configuration options to your **config/services.php** configuration file. You may copy the example configuration below to get started:

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

The **from** option is the phone number or mask that your SMS messages will be sent from. You can contact with Walletmix for more info.

#### Formatting SMS Notifications

[](#formatting-sms-notifications)

If a notification supports being sent as an SMS, you should define a toWalletmix method on the notification class. This method will receive a $notifiable entity and should return a **YHShanto\\WalletmixSMS\\Messages\\WalletmixMessage** instance:

```
/**
 * 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');
}
```

##### Unicode Content

[](#unicode-content)

If your SMS message will contain unicode characters, you should call the unicode method when constructing the **WalletmixMessage** instance:

```
/**
 * 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();
}
```

#### Customizing The "From" Number

[](#customizing-the-from-number)

If you would like to send some notifications from a **phone number/mask** that is different from the **phone number/mask** specified in your **config/services.php** file, you may use the from method on a **WalletmixMessage** instance:

```
/**
 * 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');
}
```

#### Routing SMS Notifications

[](#routing-sms-notifications)

When sending notifications via the **walletmix** channel, the notification system will automatically look for a **phone** attribute on the notifiable entity. If you would like to customize the phone number the notification is delivered to, define a **routeNotificationForWalletmix** method on the entity:

```
