Integration
A Laravel package, not a wrapper you finish yourself
Config, a ready webhook route and typed events for every incoming update — so replying to a message is an event listener, not a controller you have to write and secure yourself.
Install
composer require waapi/waapi-laravel-sdk
Configure once
Publish the config, then put your token and instance ID in .env.
Publish the config
php artisan vendor:publish \
--tag="waapi-config"
.env
WAAPI_API_TOKEN=your-token
WAAPI_INSTANCE_ID=123
Send from anywhere
use WaAPI\WaAPI\WaAPI;
$waAPI = new WaAPI();
$waAPI->sendMessage(
chatId: '50664083362@c.us',
message: 'Your order has shipped.'
);
The instance ID falls back to your config, so a single-account app never passes it.
Working with several connected accounts? Pass one to the constructor
(new WaAPI(456)), or give any
single action its own instanceId
as the last argument.
Incoming updates are events
The package registers POST /api/waapi/webhooks
and turns each delivery into a typed event. You write a listener; there is no payload
parsing and no signature check to get wrong.
use WaAPI\WaAPI\Events\MessageCreatedEvent;
class ReplyToIncoming
{
public function handle(MessageCreatedEvent $event): void
{
// your logic here
}
}
17 events ship with the package
Laravel questions
Config, events and the things worth knowing up front.
-
Laravel 10 and 11 on PHP 8.1 or newer. The package wraps waapi/waapi-php-sdk, so a plain PHP project can use that directly instead.
-
No. The package registers POST /api/waapi/webhooks and dispatches a typed event per delivery. You register a listener and never touch the raw payload.
-
Yes. The configured instance ID is only a default — every action method takes an optional instanceId as its final argument, so you can route per tenant at call time.
-
From the API tokens page in your dashboard. It is a bearer token for the REST API; the same token works for the plain PHP SDK, the n8n node and the MCP server.
-
The events are ordinary Laravel events, so a queued listener is the usual ShouldQueue interface. Outbound calls are synchronous HTTP — dispatch them from a job if you are sending in bulk.
Connect an account and start sending
One flat rate per connected account. Unlimited messages, no approval process, no per-message invoice.