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

On this page you can find all versions of the php package axolotesource/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

Laravel WhatsApp API

Latest Version Total Downloads

Laravel package to easily send WhatsApp messages using the WhatsApp Cloud API (Graph API).

Table of Contents

Installation

Publish the configuration file:

Environment variables (.env)

Features

Feature Status
Text messages ✅
Templates with components ✅
Interactive buttons (up to 3) ✅
Interactive lists with sections ✅
Images (by media ID) ✅
Images (by URL) ✅
Videos (by URL) ✅
Raw messages ✅
Image upload ✅
Video upload ✅
Retrieve media metadata ✅
Query registered templates (WhatsAppTemplate) ✅
Template pagination ✅
Phone number info (quality rating, messaging limit) ✅
Test / fake mode ✅
Document sending ❌ (TODO)
Document upload ❌ (TODO)
Audio upload ❌ (TODO)
Sticker upload ❌ (TODO)
Audio messages ❌
Sticker messages ❌
Location messages ❌
Contact messages ❌
Reaction messages ❌
Catalogs / multi-product ❌
Flow messages ❌
Webhook handling ❌
Business profile ❌

Usage

Sending templates

The first message to a new contact must be a Meta-approved template.

If you don't pass a template name, it will use the default_initial_templete config value.

Template components

Parameters

Text messages

Using textMessage (replaces text, which is deprecated):

Interactive buttons

Up to 3 quick reply buttons.

Also supports media headers:

Interactive lists

Sending images

By media ID (requires uploading the file first):

By URL:

Sending video by URL

Uploading media

Raw messages

For fully custom requests:

Querying registered templates on Meta

WhatsAppTemplate allows you to retrieve information about templates registered in your WhatsApp Business account.

Get all templates

Filters

Selecting fields

Available fields: id, name, status, category, language, components, last_updated_time, quality_score, rejected_reason.

Limit results

Pagination

TemplateDTO

Each template is returned as a TemplateDTO with the following properties:

Property Type Description
id string Template ID
name string Template name
status string Status (APPROVED, PENDING, REJECTED, etc.)
category string Category (MARKETING, UTILITY, AUTHENTICATION)
language string Language code
components array Array of ComponentDTO

Fake mode

Querying phone number info

WhatsAppPhoneNumber allows you to retrieve information about your WhatsApp Business phone number, including quality rating and messaging limit tier.

Get phone number info

PhoneNumberDTO

The phone number info is returned as a PhoneNumberDTO with the following properties:

Property Type Description
id string Phone number ID
verifiedName string Verified business name
qualityRating string Quality rating (GREEN, YELLOW, RED)
qualityScore int Quality score (0-100)
messagingLimitTier string Messaging limit tier

Fake mode

Test mode

When WHATSAPP_BUSINESS_TEST_MODE=true, all messages are automatically redirected to WHATSAPP_BUSINESS_TEST_NUMBER.

toArray() method

You can get the payload without sending it:

API Reference

Method Description
WhatsAppMessages::text($to, $previewUrl) Simple text message
WhatsAppMessages::textMessage($to, $previewUrl) Text message (replaces text)
WhatsAppMessages::templete($to, $templateName) Send approved template
WhatsAppMessages::interactiveButtons($to) Interactive buttons (up to 3)
WhatsAppMessages::interactiveList($to) Interactive list with sections
WhatsAppMessages::image($to, Media $media) Image by media ID
WhatsAppMessages::imageByUrl($to, $url) Image by URL
WhatsAppMessages::videoByUrl($to, $url) Video by URL
WhatsAppMessages::raw($request, $to, $params) Raw payload with variable replacement
WhatsAppMessages::test($to) Send "hello_world" test template
WhatsAppMessages::fake() Enable fake responses for testing
WhatsAppTemplate::all() Get all registered templates
WhatsAppTemplate::get() Get templates with filters
WhatsAppTemplate::list() Get templates with pagination (TemplateList)
WhatsAppTemplate::where($field, $value) Filter by status, category, name, language
WhatsAppTemplate::whereIn($field, $values) Filter by multiple values
WhatsAppTemplate::select($fields) Select specific fields
WhatsAppTemplate::limit($n) Limit number of results
WhatsAppPhoneNumber::info() Get phone number info instance

License

MIT


All versions of laravel-whatsapp-api with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
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 axolotesource/laravel-whatsapp-api contains the following files

Loading the files please wait ...