Simple and flexible WhatsApp API integration for Laravel, built by Octopus Team.
This package provides an easy way to send WhatsApp messages using WAAPI.
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
use OctopusTeam\Waapi\Facades\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.";
}
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 🚀');
$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.