PHP code example of laravel-notification-channels / jet-sms
1. Go to this page and download the library: Download laravel-notification-channels/jet-sms 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/ */
laravel-notification-channels / jet-sms example snippets
use NotificationChannels\JetSms\JetSmsChannel;
use NotificationChannels\JetSms\JetSmsMessage;
class ResetPasswordWasRequested extends Notification
{
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return [JetSmsChannel::class];
}
/**
* Get the JetSms representation of the notification.
*
* @param mixed $notifiable
* @return string|\NotificationChannels\JetSms\JetSmsMessage
*/
public function toJetSms($notifiable) {
return "Test notification";
// Or
return new ShortMessage($notifiable->phone_number, 'Test notification');
}
}
class User extends Authenticatable
{
use Notifiable;
public function routeNotificationForJetSms()
{
return "905123456789";
}
}