Download the PHP package nml/whatsapp-notifier without Composer
On this page you can find all versions of the php package nml/whatsapp-notifier. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nml/whatsapp-notifier
More information about nml/whatsapp-notifier
Files in nml/whatsapp-notifier
Package whatsapp-notifier
Short Description WhatsApp Cloud API Wrapper and Notification Channel for Laravel and PHP
License MIT
Homepage https://github.com/Premod1/nml-whatsapp-notifier
Informations about the package whatsapp-notifier
NML WhatsApp Notifier
NML WhatsApp Notifier is a lightweight, standalone PHP and Laravel package designed for sending WhatsApp messages via Meta Cloud API. It provides a direct client for sending plain text and template messages, as well as a native Laravel Notification Channel for seamless application integration.
- Package Name:
nml/whatsapp-notifier - Namespace:
Nml\WhatsApp\ - GitHub Repository:
https://github.com/Premod1/nml-whatsapp-notifier - Author Email:
[email protected]
Features
- Meta WhatsApp Cloud API Integration: Native integration with Graph API v20.0+.
- Dual Messaging Modes: Supports sending both plain text messages and dynamic template messages.
- Native Laravel Notification Channel: Integrates directly into Laravel's notification system.
- Fluent Message Builders: Clean fluent API for building text (
WhatsAppTextMessage) and template (WhatsAppTemplateMessage) payloads. - Fully Tested: Includes unit test suites using Orchestra Testbench.
Package Architecture
Requirements
- PHP 8.2 or higher
- Laravel 10.x, 11.x, or 12.x
- GuzzleHTTP 7.x
- Meta Developer Account with WhatsApp Cloud API enabled
Installation
Option 1: Via Composer (Recommended)
Once published to Packagist, run:
Option 2: Via Local Path (Development)
Add the local repository path to your application's composer.json:
Then run composer update:
Publish Configuration
Publish the package configuration file to your Laravel app:
Environment Configuration
Configure the required environment variables in your application .env file:
Environment Variables Description
WHATSAPP_ACCESS_TOKEN: Temporary access token or System User permanent token generated in Meta Developer Portal.WHATSAPP_PHONE_NUMBER_ID: Phone Number ID associated with your WhatsApp business app.WHATSAPP_API_VERSION: Meta Graph API version (default isv20.0).
Usage Examples
1. Direct Usage via WhatsAppClient
Send Plain Text Message
Send Template Message
2. Usage via Laravel Notification Channel
Create a notification class using Artisan:
Configure the notification class to use WhatsAppChannel:
Define the recipient routing method in your User model:
Dispatch the notification:
Testing
Run unit tests via PHPUnit:
Publishing to Packagist
-
Push code to GitHub:
-
Tag version release:
- Submit
https://github.com/Premod1/nml-whatsapp-notifieron Packagist.org.
Troubleshooting
Error Code 131030: Recipient phone number not in allowed list
Cause
When using Meta WhatsApp Sandbox / Test Phone Number, Meta restricts outgoing messages strictly to recipient numbers that have been manually added and verified in the Meta Developer Portal.
Solution
- Log in to Meta Developer Portal.
- Navigate to your App -> WhatsApp -> API Setup.
- Locate the "To" phone number dropdown and click Manage phone number list.
- Add the target phone number (with country code) and enter the OTP code received on that phone number.
License
This package is open-source software licensed under the MIT License.
All versions of whatsapp-notifier with dependencies
guzzlehttp/guzzle Version ^7.2
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/notifications Version ^10.0|^11.0|^12.0