Download the PHP package renderbit/laravel-whatsapp without Composer

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

Laravel WhatsApp (renderbit/laravel-whatsapp)

Tests Packagist Version License PHP Laravel

A framework-agnostic, Laravel-ready PHP package for sending template-based WhatsApp messages via the Renderbit WhatsApp API.

๐Ÿš€ Features

๐Ÿ“ฆ Installation

Requirements

Dependency Version
PHP >= 8.1
Laravel (optional) 10.x | 11.x
guzzlehttp/guzzle ^7.9
illuminate/support ^10.0 | ^11.0
psr/log ^1.1 | ^2.0 | ^3.0
psr/simple-cache ^1.0 | ^2.0 | ^3.0

โš™๏ธ Laravel Setup

Note: This package uses Laravel auto-discovery, so the service provider is registered automatically. No manual registration needed.

1. Publish Config (optional)

This publishes the config file and routes to your application:

2. Environment Configuration

Add these to your .env:

Configuration Reference (config/whatsapp.php)

Key Env Variable Description
api_base_url WHATSAPP_API_BASE_URL Base URL for the Renderbit WhatsApp API
api_key WHATSAPP_API_KEY API key for authentication
whatsapp_business_number WHATSAPP_BUSINESS_NUMBER Business phone number (sender)
whatsapp_username WHATSAPP_USERNAME Username for the API
old_token WHATSAPP_OLD_TOKEN Previous token (used during token refresh)

๐Ÿงฑ Usage

In Laravel

Via Dependency Injection

Via Facade

Via app() Helper

Response Format

All sendMessage() calls return a uniform response array:

In Standalone PHP

๐Ÿ” Token Management

The TokenManager class handles all authentication token lifecycle automatically.

Method Description
getToken() Returns a valid token from cache or generates a new one
refreshToken() Forces a token refresh using the old token
manageToken('enable' \| 'disable' \| 'delete', $token) Manages token state

How it works:

  1. getToken() checks PSR-16 cache for a valid (non-expired) token
  2. If cached and valid, returns immediately
  3. If expired or missing, calls generateToken() which requests a new token from the API
  4. The new token and its expiry are stored in cache with the correct TTL (in seconds)
  5. On HTTP 401 responses, WhatsappClient::sendRequest() automatically triggers refreshToken()

You can swap the cache backend to Redis, APCu, database, or any PSR-16 implementation.

๐Ÿ“ก DLR Webhook

The package registers a POST route for delivery reports:

The WhatsAppDLRController::receiveDLR() handler logs incoming delivery reports via Laravel's Log::info() and responds with {"status": "success"}.

To customize, extend the controller or disable the routes and define your own:

๐Ÿ—บ Error Code Reference

The package ships with 51 mapped error codes in Renderbit\LaravelWhatsapp\Constants\ErrorCodes:

Code Message
28694 Invalid template parameters
10001 Invalid phone number
52992 Username / Password incorrect
52995 Daily Credit limit Reached
57089 Contract expired
57090 User credit expired
57091 User disabled
65280 Service is temporarily unavailable
65535 Message does not conform to DTD
28673โ€“28704 Validation errors (destination, sender, template, etc.)
2009โ€“2026 Template format errors
9988 Unknown failure
38679โ€“65536 Campaign and system errors

You can customize messages by extending or modifying the ErrorCodes::MAP array.

๐Ÿงช Testing

The test suite covers:

CI Matrix

The package is tested via GitHub Actions across 6 configurations:

PHP Laravel
8.1 10
8.2 10
8.2 11
8.3 10
8.3 11
8.4 11

๐Ÿ“ Project Structure

๐Ÿงฉ Extending & Customization

๐Ÿค Contributing

  1. Fork the repository
  2. Install dependencies: composer install
  3. Write/run tests: vendor/bin/phpunit
  4. Submit a pull request

Please ensure all tests pass and maintain at least the current coverage level.

๐Ÿ“„ License

MIT ยฉ Renderbit Technologies


All versions of laravel-whatsapp with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
guzzlehttp/guzzle Version ^7.9
illuminate/support Version ^10.0 || ^11.0
psr/log Version ^1.1 || ^2.0 || ^3.0
psr/simple-cache Version ^1.0 || ^2.0 || ^3.0
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 renderbit/laravel-whatsapp contains the following files

Loading the files please wait ...