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.