PHP code example of zapmizer / laravel-notification-zapmizer

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

    

zapmizer / laravel-notification-zapmizer example snippets


    ZAPMIZER_API_TOKEN="JGk2PJWYppWeCmxoGjMafasdxVfbXCS3W5OWLpnII56b32dc4"
    ZAPMIZER_FROM_NUMBER="558181643260"

    /**
     * Get the notification's delivery channels.
     *
     * @return array<int, string>
     */
    public function via(object $notifiable): array
    {
        return ['mail', 'zapmizer'];
    }

    /**
     * Get the WhatsApp representation of the notification.
     */
    public function toZapmizer(object $notifiable)
    {
        $message = 'This is a message!' . PHP_EOL;

        //WID must follow the WhatsApp pattern, example: 558181643260; [email protected] [email protected](groups)

        return ZapmizerMessage::create(from: config('zapmizer.from_number'), to: $notifiable->wid)->type('chat')->text($message)->send();
    }
bash
php artisan vendor:publish --provider="Notification\Zapmizer\ZapmizerServiceProvider" --tag=config --force