PHP code example of hebinet / laravel-websms-notification-channel
1. Go to this page and download the library: Download hebinet/laravel-websms-notification-channel 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/ */
hebinet / laravel-websms-notification-channel example snippets
/**
* Get the WebSMS / SMS representation of the notification.
*
* @param mixed $notifiable
* @return string
*/
public function toWebsms($notifiable)
{
return 'Your SMS message content';
}
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
/**
* Route notifications for the WebSms channel.
*
* @param \Illuminate\Notifications\Notification $notification
* @return string
*/
public function routeNotificationForWebsms($notification)
{
return $this->phone_number;
}
}
bash
php artisan vendor:publish --provider="Hebinet\Notifications\WebSmsChannelServiceProvider" --tag=config