Skip to content

Commit f57475a

Browse files
authored
Update README.md
1 parent 5ae212f commit f57475a

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,39 @@ Currently, only textlocal of two country is supported IN(India) and UK(United Ki
6969

7070
Implement this method `routeNotificationForTextlocal()` in your notifiable class/model which will return array of mobile numbers. Please make sure the mobile number contains the dial code as well (e.g +91 for India). And lastly implement `toSms()` method in the notification class which will return the (string) sms or template that is defined in textlocal account that needs to be send.
7171

72+
73+
## Usage
74+
75+
You can use the channel in your `via()` method inside the notification:
76+
77+
```php
78+
use Illuminate\Notifications\Notification;
79+
use NotificationChannels\Textlocal\TextlocalChannel;
80+
81+
class TestOTPNotification extends Notification
82+
{
83+
public function via($notifiable)
84+
{
85+
return [TextlocalChannel::class];
86+
}
87+
88+
public function toSms($notifiable)
89+
{
90+
return SmscRuMessage::create("Task #{$notifiable->id} is complete!");
91+
}
92+
}
93+
```
94+
95+
In your notifiable model, make sure to include a `routeNotificationForTextlocal()` method, which returns a phone number or multiple numbers in array
96+
or an array of phone numbers.
97+
98+
```php
99+
public function routeNotificationForTextlocal(): array
100+
{
101+
return [$this->mobile_no];
102+
}
103+
```
104+
72105
### Available Message methods
73106

74107
A list of all available options
@@ -95,6 +128,7 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
95128

96129
- [Manash Jyoti Sonowal](https://github.com/msonowal)
97130
- [Mr Ejang](https://github.com/tomonsoejang)
131+
- [Sinadh](https://github.com/tsainadh)
98132
- [All Contributors](../../contributors)
99133

100134
## License

0 commit comments

Comments
 (0)