1. Go to this page and download the library: Download mnovik/laravel-zadarma 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/ */
/**
* Get the SMS message.
*
* @param mixed $notifiable
* @return string
*/
public function toZadarmaSms($notifiable)
{
return 'Hello, this is an SMS sent through Zadarma API';
}
/**
* Get the notification channels.
*
* @param mixed $notifiable
* @return array|string
*/
public function via($notifiable)
{
return [ZadarmaSmsChannel::class];
}
/**
* Gets a phone/SIP number, a PBX extension number or a PBX scenario to which the
* phone callback will be made.
*
* @param mixed $notifiable
* @return string
*/
public function toZadarmaPhoneCall($notifiable)
{
return 100;
}
/**
* Get the notification channels.
*
* @param mixed $notifiable
* @return array|string
*/
public function via($notifiable)
{
return [ZadarmaPhoneCallChannel::class];
}
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
/**
* Route notifications for the Zadarma channels.
*
* @param \Illuminate\Notifications\Notification $notification
* @return string
*/
public function routeNotificationForZadarma($notification)
{
return $this->phone;
}
}