Download the PHP package shadowbane/laravel-wablas without Composer
On this page you can find all versions of the php package shadowbane/laravel-wablas. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shadowbane/laravel-wablas
More information about shadowbane/laravel-wablas
Files in shadowbane/laravel-wablas
Package laravel-wablas
Short Description Send Simple WhatsApp message via Wablas API
License GPL-3.0-or-later
Informations about the package laravel-wablas
Laravel Wablas
About
This package provides easy integration with Wablas Indonesia, provider for sending WhatsApp message via HTTP API.
Installation
install the package via composer:
Publishing Config
Usage
Configuration
add the following value to your .env
file
WABLAS_ENDPOINT
Fill it with the url for Wablas API Endpoint.
WABLAS_TOKEN
This is the token generated from your Wablas account.
WHATSAPP_NUMBER_FIELD
This is where you store the user's WhatsApp number in users
table.
WHATSAPP_NUMBER_JSON_FIELD
only fill this if you store user's WhatsApp number on JSON column in database, for example, the data might look like this:
DEBUG_WHATSAPP_NUMBER
This is used when your APP_ENV
is set to 'production' and 'APP_DEBUG' is set to true, to prevent sending it to real user.
Sending Text Message
You can send text message using 'via' method inside notification class.
app/notifications/WhatsAppNotification
:
Change token
If your application has multiple token for multiple purpose, you can chain token($token)
method to your LaravelWablasMessage
instance
Send Using The Notifiable Trait
If you want to send it via notifiable, you can refer to this example:
Then, you can trigger it with:
Sending to Multiple Users
This packages allows array to be passed as parameter in to()
methods.
As Wablas allows comma-separated values as phone number, we automatically implode the array, and send it as comma-separated value to Wablas API.
Example:
If you prefer to send it to notifiables, you can send it via notification facade.
Notes
If you send it to notifiable, please make sure your WHATSAPP_NUMBER_FIELD
reflecting the field where you store your user's WhatsApp number.
Changelog
Please see CHANGELOG for more information what has changed recently.
Security
If you discover any security related issues, please send email to [email protected] instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
All versions of laravel-wablas with dependencies
ext-json Version *
guzzlehttp/guzzle Version ^7.0
illuminate/notifications Version ^8.0
illuminate/support Version ^8.0