Download the PHP package logicalcrow/laravel-whatsapp-api without Composer

On this page you can find all versions of the php package logicalcrow/laravel-whatsapp-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-whatsapp-api

Whatsapp Business Cloud API for Laravel

A Laravel package for the Whatsapp Business Cloud API.

Installation

Configuration

You will need to set the WHATSAPP_TOKEN and WHATSAPP_NUMBER_ID values in your .env.

For further configuration, please see config/whatsapp.php. You can modify the configuration by copying it to your local config directory or by defining the environment variables used in the config file:

Usage

You can send a messages to a single or multiple clients.

You can also respond to other messages in the conversation with any message type (except reaction message):

and you can mark messages as read:

By default the messages will be sent from the default_number_id, if you want to use other you can use Whatsapp::numberId() or add the alias to the config's numbers list and use Whatsapp::numberName(). Also you can set the token manually with Whatsapp::token() or you can set both the token and numberId you can use Whatsapp::client()

Supported messages

Media

You can also manage media with:

Business Profile

There are also two ways to manage the number's business profile:

Webhooks

Whatsapp allows you to subscribe to webhooks to receive notifications and most importantly messages from your customers. Both subscriptions and notifications are handled out of the box in the route whatsapp/webhook (you can change the path with the WHATSAPP_WEBHOOK_PATH env variable).

When a you register the webhook meta will send a subscription, this requires a verification token that you set, you will need to set it with WHATSAPP_WEBHOOK_VERIFY_TOKEN env setting. When receiving a subscription intent a Logicalcrow\Whatsapp\Events\SubscriptionIntentReceived event will be fired, if the request is successful the Logicalcrow\Whatsapp\Events\SuccessfullySubscribed event will fire too.

On the other hand notifications will trigger a Logicalcrow\Whatsapp\Events\WebhookReceived event with all the payload, if you want to protect this route verifying the sha256 signature you must set the WHATSAPP_WEBHOOK_SIGNATURE_VERIFY to true and the WHATSAPP_SECRET to your whatsapp's app secret.

If the payload is invalid a Logicalcrow\Whatsapp\Events\UnprocessableWebhookPayload event will be fired with the exception describing the error.

If you want to know when a specific notification is fired you can subscribe to this events:

Notification Channel

This library has support for channel notification, just add the routeNotificationForWhatsapp() function to the Notifiable user (it can return a single whatsapp_id or an array of them):

Now just create a notification that implements the toWhatsapp() function:

Now you can send whatsapp notifications:

Configuration file

Missing features

License

This project is licensed under the MIT License.


All versions of laravel-whatsapp-api with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^10|^11
illuminate/support Version ^10|^11
illuminate/http Version ^10|^11
illuminate/routing Version ^10|^11
illuminate/events Version ^10|^11
illuminate/notifications Version ^10|^11
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package logicalcrow/laravel-whatsapp-api contains the following files

Loading the files please wait ....