PHP code example of atozpw / bree-whatsapp

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

    

atozpw / bree-whatsapp example snippets


'providers' => [
    ....

    Atozpw\BreeWhatsapp\ApiServiceProvider::class,
]
 artisan vendor:publish --provider="Atozpw\BreeWhatsapp\ApiServiceProvider"



return [
    'bree_whatsapp_host' => env('BREE_WHATSAPP_HOST', ''),
];



use Atozpw\BreeWhatsapp\Api;
    
class WhatsappController extends Controller
{
    public function sendMessage() {
        $bree = new Api;
        $number = 'nomor whatsapp';
        $message = 'text';
        $bree->sendText($number, $message);
    }

    public function sendMedia() {
        $bree = new Api;
        $number = 'nomor whatsapp';
        $caption = 'text';
        $file = 'berupa file gambar *jpg/png';
        $bree->sendMedia($number, $caption, $file);
    }
}