public function routeNotificationForInfobip()
{
return '+1234567890';
}
use App\Notifications\ExampleInfobipNotification;
use Illuminate\Support\Facades\Notification;
Notification::send($user, new ExampleInfobipNotification());
// where $user implements `Illuminate\Notifications\Notifiable` trait
use App\Notifications\ExampleInfobipNotification;
$user->notify(new ExampleInfobipNotification($invoice));
namespace App\Notifications;
use Illuminate\Notifications\Notification;
use Caherrera\Laravel\Notifications\Channels\Infobip\Omni\InfobipChannel;
use Caherrera\Laravel\Notifications\Channels\Infobip\Omni\InfobipMessage;
class ExampleInfobipNotification extends Notification
{
public function via($notifiable)
{
return [InfobipChannel::class];
}
public function toInfobip($notifiable)
{
$message = new InfobipMessage();
$message->setTemplateName("infobip_test_hsm");
$message->setTemplateNamespace("whatsapp:hsm:it:infobip");
$message->setTemplateData(["Jhon","Snow"]);
$message->setLanguage("es");
return $message;
}
}
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use Notifiable;
}
php
use NotificationChannels\Infobip\InfobipChannel;
use NotificationChannels\Infobip\InfobipMessage;
use Illuminate\Notifications\Notification;
class AccountApproved extends Notification
{
public function via($notifiable)
{
return [InfobipChannel::class];
}
public function toInfobip($notifiable)
{
$message = new InfobipMessage();
$message->setTemplateName("infobip_test_hsm");
$message->setTemplateNamespace("whatsapp:hsm:it:infobip");
$message->setTemplateData(["Jhon","Snow"]);
$message->setLanguage("es");
return $message;
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.