PHP code example of krish033 / netty

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

    

krish033 / netty example snippets





namespace App\Otpfy\Templates;

use Krish033\Otpfy\Contracts\Netty;

class LoginTemplate implements Netty
{


    /**
    * DLT Template ID, get the approved DLT Message Template
    */
    public function template(): string
    {
        return ''; // add template id
    }




    /**
    * The message body, which should be approved by DLT
    */
    public function message(): string
    {
        return "say hii to {{ nettyfish }}"; // add template approved message
    }
}



// app/Otpfy/Templates/TemplateName
public function __construct(public array $data)
{
    //
}

use App\Otpfy\Templates\YourTemplate;
use Krish033\Otpfy\Facades\Message;

/**
* Send message
*/
Message::send(YourTemplate::class)->to("987654XXXX");

bash
php artisan vendor:publish --tag=config
bash
php artisan otpfy:make TemplateName