Simple and flexible WhatsApp API integration for Laravel, built by Octopus Team.
This package provides an easy way to send WhatsApp messages using WAAPI.
This package supports the following Laravel and PHP versions:
Laravel Version | PHP Version(s) | Supported |
---|---|---|
12.x | 8.3, 8.4 | ✅ |
11.x | 8.2, 8.3 | ✅ |
10.x | 8.1, 8.2, 8.3 | ✅ |
9.x | 8.0, 8.1, 8.2 | ✅ |
8.x | 7.4, 8.0, 8.1 |
ℹ️ We recommend always using the latest Laravel LTS and PHP stable versions for security and performance.
Install via Composer:
composer require octopusteam/waapi-laravel
- Publish the config file:
php artisan vendor:publish --provider="OctopusTeam\Waapi\WaapiServiceProvider" --tag="config"
- A new config file will be created at:
config/waapi.php
- Update your
.env
with your WAAPI credentials with the following variables in config/waapi.php:
WAAPI_URL="https://api.example.com/v1/"
WAAPI_APP_KEY=xxxxxxxxxxxxxxxxx
WAAPI_AUTH_KEY=xxxxxxxxxxxxxxxx
To use this package, you need to create an account and generate your WAAPI keys:
- Go to 👉 https://waapi.octopusteam.net
- Sign up for a free trial (7 days available 🚀)
- Choose a subscription plan (affordable options for continued API access)
- After login, go to My Apps → Integration
- Copy your
appkey
andauthkey
from the dashboard
Since v1.0.6, the package includes a Waapi
facade for easier static access:
use Waapi;
Waapi::sendOtp('201234567890', '123456');
Waapi::sendMessage('201234567890', 'Hello from Octopus Team 🚀');
Waapi::sendBulkMessages(['201234567890','201234567891'], 'Hello from Octopus Team 🚀');
use Waapi;
$phone = '201234567890';
$message = 'Hello from Octopus Team 🚀';
$response = Waapi::sendMessage($phone, $message);
if ($response->successful()) {
echo "Message sent successfully!";
} else {
echo "Failed to send message.";
}
use Waapi;
$phones = ['201234567890','201234567891','201234567892'];
$message = 'Hello from Octopus Team 🚀';
$response = Waapi::sendBulkMessages($phones, $message);
if ($response->successful()) {
echo "Messages sent successfully!";
} else {
echo "Failed to send messages.";
}
This package comes with a basic test example.
Run tests with:
php artisan test
See tests/Feature/WaapiTest.php
for a sample test:
$response = Waapi::sendMessage('201234567890', 'Hello from Waapi Test 🚀');
$response = Waapi::sendBulkMessages(['201234567890','201234567891'], 'Hello from Waapi Test 🚀');
$this->assertNotNull($response);
Contributions are welcome!
Please open issues and submit pull requests to help improve this package.
This package is open-sourced software licensed under the MIT license.