PHP code example of sbudah / panaceamobile

1. Go to this page and download the library: Download sbudah/panaceamobile 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/ */

    

sbudah / panaceamobile example snippets


// config/app.php
'providers' => [
    ...
    NotificationChannels\PanaceaMobile\PanaceaMobileServiceProvider::class,
];

// config/services.php

'panaceamobile' => [
    'login'  => env('PANACEAMOBILE_LOGIN'), // Your Username
    'secret' => env('PANACEAMOBILE_SECRET'), // Your Token
    'sender' => 'Sbudah' // Phone number to send SMS from
]

use Illuminate\Notifications\Notification;
use NotificationChannels\PanaceaMobile\PanaceaMobileMessage;
use NotificationChannels\PanaceaMobile\PanaceaMobileChannel;

class AccountApproved extends Notification
{
    public function via($notifiable)
    {
        return [PanaceaMobileChannel::class];
    }

    public function toPanaceaMobile($notifiable)
    {
        return (new PanaceaMobileMessage())
            ->content("Your {$notifiable->service} account was approved!");
    }
}

// app/User.php

public function routeNotificationForPanaceaMobile()
{
    return '27111000101';
}



namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable;

    /**
     * Route notifications for the Nexmo channel.
     *
     * @return string
     */
    public function routeNotificationForPanaceaMobile()
    {
        return $this->phone;
    }
}