Skip to content

Simple and flexible WhatsApp API integration for Laravel, built by Octopus Team. This package provides an easy way to send WhatsApp messages using WAAPI.

License

Notifications You must be signed in to change notification settings

octopus-software-team/waapi-laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest Version on Packagist Total Downloads License

https://waapi.octopusteam.net
Simple and flexible WhatsApp API integration for Laravel, built by Octopus Team.
This package provides an easy way to send WhatsApp messages using WAAPI.

🛠️ Compatibility

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 ⚠️ (no longer officially supported by Laravel, but package works)

ℹ️ We recommend always using the latest Laravel LTS and PHP stable versions for security and performance.

📦 Installation

Install via Composer:

composer require octopusteam/waapi-laravel

⚙️ Configuration

  1. Publish the config file:
php artisan vendor:publish --provider="OctopusTeam\Waapi\WaapiServiceProvider" --tag="config"
  1. A new config file will be created at:
config/waapi.php
  1. 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

🔑 Get Your API Key

To use this package, you need to create an account and generate your WAAPI keys:

  1. Go to 👉 https://waapi.octopusteam.net
  2. Sign up for a free trial (7 days available 🚀)
  3. Choose a subscription plan (affordable options for continued API access)
  4. After login, go to My AppsIntegration
  5. Copy your appkey and authkey from the dashboard

🚀 Usage

Using the Facade (Recommended)

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 🚀');

Send WhatsApp Message

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.";
}

Send Bulk WhatsApp Messages

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.";
}

🧪 Testing

This package comes with a basic test example.

Run tests with:

php artisan test

📖 Example 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);

🤝 Contributing

Contributions are welcome!
Please open issues and submit pull requests to help improve this package.

📜 License

This package is open-sourced software licensed under the MIT license.

✨ Credits

About

Simple and flexible WhatsApp API integration for Laravel, built by Octopus Team. This package provides an easy way to send WhatsApp messages using WAAPI.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages