use Illuminate\Notifications\Notification;
use NotificationChannels\GreenApi\GreenApiMessage;
use NotificationChannels\GreenApi\GreenApiChannel;
class AccountApproved extends Notification
{
public function via($notifiable)
{
return [GreenApiChannel::class];
}
public function toGreenApi($notifiable)
{
return GreenApiMessage::create("Task #{$notifiable->id} is complete!");
}
}
public function routeNotificationForGreenApi()
{
return $this->mobile; //depend what is your db field
}
// routes/web.php
$this->get('preview-notification', function () {
$user = User::where('email', '[email protected]')->first();
Notification::route('greenapi', $user->mobile)->notify(
new \App\Notifications\SendTest()
);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.