PHP code example of laravel-notification-channels / gammu
1. Go to this page and download the library: Download laravel-notification-channels/gammu 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 / gammu example snippets
namespace App\Notifications;
use NotificationChannels\Gammu\GammuChannel;
use NotificationChannels\Gammu\GammuMessage;
use Illuminate\Notifications\Notification;
class SendNotificationToSms extends Notification
{
public function via($notifiable)
{
return [GammuChannel::class];
}
public function toGammu($notifiable)
{
return (new GammuMessage())
->to($phoneNumber)
->content($content);
}
}
public function toGammu($notifiable)
{
return (new GammuMessage())
->to($phoneNumber)
->sender($sender)
->content($content);
}
...
/**
* Route notifications for the Gammu channel.
*
* @return string
*/
public function routeNotificationForGammu()
{
return $this->phone;
}
...