PHP code example of ahmedsalah / kenda-communication-plugin

1. Go to this page and download the library: Download ahmedsalah/kenda-communication-plugin 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/ */

    

ahmedsalah / kenda-communication-plugin example snippets


return [

    'api_key' => env('KENDA_COMMUNICATION_PLUGIN_API_KEY', 'kn-...'),
    'from_phone' => env('KENDA_COMMUNICATION_PLUGIN_FROM_PHONE', '254712345678'),
    
    'public_key_path' => env('KENDA_COMMUNICATION_PLUGIN_PUBLIC_KEY_PATH', 'public_key_server.kendaKey'),

    'enable_user_resolving' => env('KENDA_COMMUNICATION_PLUGIN_ENABLE_USER_RESOLVING', true),
    'enable_guest_user' => env('KENDA_COMMUNICATION_PLUGIN_ENABLE_GUEST_USER', true),

    'user_model' => env('KENDA_COMMUNICATION_PLUGIN_USER_MODEL', 'App\Models\User'),
    'user_phone_number_column' => env('KENDA_COMMUNICATION_PLUGIN_USER_PHONE_NUMBER_COLUMN', 'phone_number'),

    'functions' => [
        'example_function' => 'App\KendaCommunicationPlugin\Functions\ExampleFunction',
    ],
];

return [
    'functions' => [
        'createUser' => 'App\KendaCommunicationPlugin\Functions\CreateUser',
        'writeArticle' => 'App\KendaCommunicationPlugin\Functions\WriteArticle',
    ],
];

KendaCommunicationPlugin::sendWhatsappMessage(string $targetPhone, string $message);
bash
php artisan vendor:publish --tag="kenda-communication-plugin-config"
bash
php artisan kenda:generate-function