Every message type
Text, media, templates, reply buttons, lists, WhatsApp Flows, locations, contacts, reactions and catalog messages, with replies that quote the customer's message.
Send messages and templates, receive webhooks as events, and send notifications on a whatsapp channel, using Meta's WhatsApp Business Cloud API.
Send a message from anywhere in your app:
use Crenspire\Whatsapp\Facades\Whatsapp;
Whatsapp::sendTextMessage('15551234567', 'Your order has shipped.');
Whatsapp::sendTemplateMessage('15551234567', 'order_shipped', ['Sarah', '#1042']);Or send it as a notification:
class OrderShipped extends Notification
{
public function __construct(public Order $order) {}
public function via(object $notifiable): array
{
return ['whatsapp'];
}
public function toWhatsapp(object $notifiable): WhatsappMessage
{
return WhatsappMessage::template('order_shipped', [$notifiable->name, $this->order->number]);
}
}And reply to customers from an event listener:
Event::listen(function (MessageReceived $event) {
if ($event->text() === 'status') {
Whatsapp::showTypingIndicator($event->messageId);
Whatsapp::sendTextMessage($event->from, 'Your order ships today.', replyTo: $event->messageId);
}
});Requires PHP 8.2+ and Laravel 12 or 13. Install it in a few minutes →