1. Go to this page and download the library: Download bitcodesa/msegat library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
class User extends Authenticatable
{
use \BitcodeSa\Msegat\Messageable;
}
$user->messages
namespace App\Notifications\ReservationNotifications;
use App\Models\Reservation;
use BitcodeSa\Msegat\MsegatMessage;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use BitcodeSa\Msegat\MsegatChannel;
class Reservation extends Notification
{
use Queueable;
protected Reservation $reservation;
public function __construct(Reservation $reservation)
{
$this->reservation = $reservation;
}
public function via(object $notifiable): array
{
return [
MsegatChannel::class,
// Other notification channels
];
}
public function toMsegat()
{
return new MsegatMessage($this->reservation->title);
}
// Other notification methods
}
class SendOtp extends Notification
{
use Queueable;
public function __construct()
{
//
}
public function via(object $notifiable): array
{
return [MsegatChannel::class];
}
public function toMsegat()
{
return (new MsegatMessage())
->type(MsegatMessage::TYPE_OTP)
->lang("en");
}
}
$user = \App\Models\User::first();
$otp = new \BitcodeSa\Msegat\MsegatVerifyOtp();
$otp->validate($user, $code);
class User extends Authenticatable
{
use Notifiable;
public function routeNotificationForMsegat()
{
return $this->mobile;
}
}