Developer guides
How to Send WhatsApp Messages in Laravel
Install the Hypersender Laravel SDK, send your first WhatsApp message, and handle queued requests and webhooks in your Laravel app.

Need to send a WhatsApp message from Laravel? This guide walks through connecting a number to Hypersender, installing the Laravel SDK, and sending a first message. It also covers queued jobs and incoming-message webhooks. For the complete, current package reference, see the Laravel SDK documentation.
Hypersender connects a WhatsApp account by QR code. It is a separate service from Meta's official WhatsApp Business Platform. Review the WhatsApp API plans and account requirements before choosing it for a production workflow.
What You'll Need
Before getting started, you need:
- A Laravel application (8.x or higher)
- PHP 8.2+
- A Hypersender account (sign up here)
- Your API key and Instance ID from the Hypersender dashboard
Installation
Install the Hypersender SDK via Composer:
composer require hypersender/hypersender-laravelPublish the config file:
php artisan vendor:publish --tag=hypersender-configAdd your credentials to your .env file:
HYPERSENDER_WHATSAPP_API_KEY=your_api_key
HYPERSENDER_WHATSAPP_INSTANCE_ID=your_instance_idYou can find your API key and Instance ID in your Hypersender dashboard under Settings.
Sending Your First Message
Here's the simplest way to send a WhatsApp message:
use Hypersender\Hypersender;
$response = Hypersender::whatsapp()->safeSendTextMessage(
'20123456789@c.us',
'Hello from Laravel!'
);
// Throw an exception for a non-success HTTP response.
$response->throw();
// V2 queues the message; this is a queue ID, not a delivery receipt.
$queuedRequestUuid = $response->json('queued_request_uuid');Run this from a Laravel controller or php artisan tinker after setting the credentials above. The chat ID format is the phone number with country code followed by @c.us; for example, +1 (202) 555-0123 becomes 12025550123@c.us. A successful HTTP response confirms that the API accepted the queued request, not that WhatsApp delivered the message. See the queued requests guide to track processing.
The SDK also provides a safeSendTextMessage helper. Confirm its current behavior in the send messages reference; helper names do not guarantee that an account will avoid restrictions. Send only messages that comply with applicable WhatsApp terms and recipient expectations.
Sending Different Message Types
Images
Hypersender::whatsapp()
->sendImageUrl(
chatId: '20123456789@c.us',
url: 'https://example.com/image.jpg',
fileName: 'image.jpg',
mimeType: 'image/jpeg',
caption: 'Check this out!'
);For uploads, pass an Illuminate\Http\UploadedFile to the SDK's sendImageFile method. See the Laravel image methods for its current parameters.
Videos
Hypersender::whatsapp()
->sendVideoUrl(
chatId: '20123456789@c.us',
url: 'https://example.com/video.mp4',
asNote: false,
caption: 'Tutorial video'
);Documents
Hypersender::whatsapp()
->sendFileUrl(
chatId: '20123456789@c.us',
url: 'https://example.com/invoice.pdf',
fileName: 'invoice.pdf',
mimeType: 'application/pdf',
caption: 'Your invoice'
);Location
Hypersender::whatsapp()
->sendLocation(
chatId: '20123456789@c.us',
latitude: 37.7749,
longitude: -122.4194,
title: 'Our Office'
);Using Queues for Better Performance
Sending messages synchronously can slow down your app. Use Laravel queues to send messages in the background:
namespace App\Jobs;
use Hypersender\Hypersender;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
class SendWhatsAppMessage implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable;
public function __construct(
public string $chatId,
public string $message
) {}
public function handle(): void
{
Hypersender::whatsapp()
->safeSendTextMessage(
chatId: $this->chatId,
text: $this->message
)
->throw();
}
}This Laravel queue runs the job in your application. The API separately queues each accepted message request; use the returned UUID and the queued requests guide to track it.
Dispatch the job:
SendWhatsAppMessage::dispatch($chatId, $message);Handling Incoming Messages
The Laravel SDK registers a webhook route and dispatches typed events after signature verification. Follow the webhook handling guide to configure the route and listen for the event types supported by the installed SDK version.
Common Issues
Messages Not Sending
Make sure your WhatsApp number is connected in the Hypersender dashboard. You need to scan the QR code before you can send messages.
Invalid Chat ID Format
The chat ID must be in the format phonenumber@c.us. Don't include the + sign or any spaces. Just digits followed by @c.us.
Rate Limiting
Check the API response and current plan limits, confirm that the instance is connected, and review the SDK's queued requests guide for background processing. A helper method or delay does not guarantee delivery or prevent account restrictions.
Next Steps
Now that you know the basics, you can:
- Set up webhook handling for two-way conversations
- Check queued requests for API processing and message acknowledgements for delivery
- Inspect and retry failed webhook deliveries
- Explore the full API documentation
The complete SDK documentation is available at docs.hypersender.com.
Ready to send from your own app? Create a Hypersender account to get your API key and Instance ID.


