Download the PHP package vibrantcoder/whatsapp-notifier without Composer
On this page you can find all versions of the php package vibrantcoder/whatsapp-notifier. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vibrantcoder/whatsapp-notifier
More information about vibrantcoder/whatsapp-notifier
Files in vibrantcoder/whatsapp-notifier
Package whatsapp-notifier
Short Description Reusable Laravel package for sending WhatsApp notifications via multiple drivers (Twilio, Meta Cloud API).
License MIT
Homepage https://github.com/vibrantcoder/whatsapp-notifier
Informations about the package whatsapp-notifier
WhatsApp Notifier for Laravel
Reusable Laravel package for sending WhatsApp messages through multiple drivers (Twilio, Meta Cloud API) with dynamic templates, queues, events, and DB logging. Works with Laravel 10, 11, 12, 13.
Features
- Driver pattern —
meta,twilio, or your own custom driver. - Fluent template builder —
metaTemplate()for any Meta template (text body, image/video/document headers, URL/quick-reply/copy-code buttons, location, named placeholders). - Template registry — declare each template once in config, reference by alias from app code.
- Queue support — fire-and-forget async delivery via Laravel queues.
- Events —
WhatsAppMessageSending,WhatsAppMessageSent,WhatsAppMessageFailed. - DB logging — every send attempt persisted to
whatsapp_messages(success or failure, with full Meta response). - Service provider + facade — auto-discovered, no manual registration.
Requirements
- PHP 8.1+
- Laravel 10, 11, 12, or 13
- Composer 2.x
Installation
There are three ways to install — pick the one that matches where the package lives.
Option 1 — Local path repository (during development)
Use this when the package source lives inside or next to your Laravel app
(e.g. packages/vibrantcoders/whatsapp-notifier).
In your Laravel app's composer.json:
The
@devconstraint is required because path repos publish asdev-main.symlink: truemeans edits inside the package are picked up immediately.
Option 2 — Private Git repository
Option 3 — Public Packagist (once published)
Setup (after install)
One command does everything — publishes config, migrations, env keys, and runs migrate:
Service provider and facade are auto-discovered — no manual registration in
config/app.php is required.
For the manual breakdown, see INSTALL.md.
Environment variables
Add the relevant block to your .env:
⚠️ The Meta temporary access token expires every 24 hours. For production, generate a System User token from Meta Business Settings (60-day or never-expiring).
Usage
1. Inline free-form message (Meta or Twilio)
Free-form messages are only deliverable in the 24-hour customer-care window on Meta. Use templates outside that window.
2. Meta template via the registry (recommended)
Declare each template once in config/whatsapp.php:
Then in your code:
3. Meta template via the fluent builder
Use this when the template has dynamic header/buttons that vary per call, or when you don't want to maintain the registry.
4. Override driver per call
5. Force sync or queue
6. Event-driven delivery (recommended for app code)
Laravel auto-discovers the listener from the typehint — no EventServiceProvider
mapping required (Laravel 11+).
Supported template features
| Feature | Builder method | Registry key |
|---|---|---|
Body {{1}} {{2}} |
body(...$values) |
'body' => [...] |
Named body {{name}} |
bodyNamed(['k' => 'v']) |
(use builder) |
| Header text | headerText('...') |
'header' => 'text' |
| Header image | headerImage($url) |
'header' => 'image' |
| Header video | headerVideo($url) |
'header' => 'video' |
| Header document | headerDocument($url, $filename) |
'header' => 'document' |
| Header location | headerLocation($lat, $lng, $name, $addr) |
(use builder) |
| URL button | urlButton($index, $value) |
'buttons' => [['type' => 'url']] |
| Quick-reply button | quickReplyPayload($index, $payload) |
'buttons' => [['type' => 'quick_reply']] |
| Copy-code button | copyCodeButton($index, $code) |
'buttons' => [['type' => 'copy_code']] |
| Raw passthrough | withRawComponents([...]) |
— |
Custom drivers
Register in any service provider's boot():
Then WhatsApp::via('myprovider')->message(...)->send(...).
Logged messages
Every attempt — sync or queued, success or failure — is persisted:
Columns:
| Column | Type |
|---|---|
id |
bigint |
driver |
varchar (32) |
to |
varchar (32) |
body |
text |
status |
pending|sent|failed |
provider_id |
varchar |
error |
text (nullable) |
response |
json (nullable) |
sent_at |
timestamp |
created_at |
timestamp |
updated_at |
timestamp |
Quick test (5 minutes, no real templates needed)
You should receive a real WhatsApp message and see a row in the
whatsapp_messages table with status = sent and a provider_id returned
by Meta.
Troubleshooting
| Symptom | Cause / fix |
|---|---|
(#132001) Template name does not exist in the translation |
Template not approved, wrong name, or wrong language code. Check WhatsApp Manager. |
(#131030) Recipient phone number not in allowed list |
You're using Meta's free test number — add the recipient under "Send messages to" in API Setup. |
Invalid OAuth access token |
Temp token expired (24h). Generate a new one in API Setup, paste into .env, run php artisan config:clear. |
Meta template alias [...] is not registered |
Add the alias to meta_templates in config/whatsapp.php, or use builder mode. |
| Sends silently fail outside 24h window | Meta only allows template messages outside the customer-care window. Use metaTemplate(), not message(). |
| Queue jobs not running | Make sure a worker is running: php artisan queue:work --queue=whatsapp |
Roadmap
- [ ] Webhook receiver to update
whatsapp_messagesstatus from Meta callbacks (delivered/read/failed) - [ ] Inbound message handling (conversations + agents)
- [ ] Carousel + authentication (OTP) template helpers
- [ ] Rate limiting per Meta tier (1k / 10k / 100k / unlimited messages-per-day)
License
MIT © VibrantCoders
All versions of whatsapp-notifier with dependencies
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/queue Version ^10.0|^11.0|^12.0|^13.0
illuminate/events Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
guzzlehttp/guzzle Version ^7.5