PHP code example of digiworld / digichat

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

    

digiworld / digichat example snippets


use DigiWorld\DigiChat\Facades\DigiChat;

Route::get('/test-digichat', function () {
    try {
        $response = DigiChat::sendMessage(
            "PHONE_NUMBER", // recipient phone number without + or 0 like this 963
            "Test from local package" // message content
        );

        return response()->json($response);
    } catch (\Exception $e) {
        return response()->json([
            'error' => $e->getMessage()
        ], 500);
    }
});
bash
php artisan digichat:install