Documentation Advanced Usage

Testing

Deep dive into extensive customization options.

Testing

Test your WhatsApp integration.

Configure Tests

use Tests\TestCase;

class WhatsappTest extends TestCase
{
    public function test_send_text_message()
    {
        $response = Whatsapp::sendTextMessage(
            phoneId: '123456789',
            to: '5491234567890',
            message: 'Test message'
        );

        $this->assertTrue($response['success']);
    }
}

Run Tests

php artisan test --filter WhatsappTest

Local Development

Use ngrok to test webhooks locally:

ngrok http 8000

πŸ’‘ Testing<br />
Always test in a development environment before production.

Share this page