You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,39 @@ Currently, only textlocal of two country is supported IN(India) and UK(United Ki
69
69
70
70
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.
71
71
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
+
72
105
### Available Message methods
73
106
74
107
A list of all available options
@@ -95,6 +128,7 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
0 commit comments