Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
L

laravel-notification-whatsapp

> 后端框架
Open source

Laravel notification channel for Whatsapp Cloud API

185 stars0 likes1 views
WebsiteGitHub

About

Laravel notification channel for Whatsapp Cloud API

WhatsApp notification channel for Laravel

This package makes it easy to send notifications using WhatsApp Cloud API with Laravel.

This package uses the whatsapp-cloud-api library that will allow you to send messages via the WhatsApp Cloud API from any type of project and framework written in PHP.

Contents

  • Installation
    • Setting up the WhatsApp service
  • Usage
    • Available Message methods
  • Changelog
  • Testing
  • Security
  • Contributing
  • Credits
  • License

Installation

You can install the package via composer:

composer require netflie/laravel-notification-whatsapp

Setting up the WhatsApp Cloud API

Create a new Meta application and get your Whatsapp application token and phone number id following the "Get Started" guide. Place them inside your .env file. To load them, add this to your config/services.php file:

php
 [
        'from-phone-number-id' => env('WHATSAPP_FROM_PHONE_NUMBER_ID'),
        'token' => env('WHATSAPP_TOKEN'),
    ],

];

Usage

The Whatsapp API only allows you to start conversations if you send a template message. This means that you will only be able to send template notifications from this package.

Whatsapp forces you to configure your templates before using them. You can learn how to configure your templates by following Meta's official guide on "How to create templates".

WhatsApp templates sections

A template is divided into 4 sections: header, body, footer and buttons. The header, body and buttons accept variables. The footer doesn't accept variables. You can only send variables from this package for the header and body.

Components

You have available several components that can be used to add context (variables) to your templates. The different components can be created with the component factory:

php
name('sample_movie_ticket_confirmation') // Name of your configured template
            ->header(Component::image('https://lumiere-a.akamaihd.net/v1/images/image_c671e2ee.jpeg'))
            ->body(Component::text('Star Wars'))
            ->body(Component::dateTime(new \DateTimeImmutable))
            ->body(Component::text('Star Wars'))
            ->body(Component::text('5'))
            ->buttons(Component::quickReplyButton(['Thanks for your reply!']))
            ->buttons(Component::urlButton(['reply/01234'])) // List of url suffixes
            ->to('34676010101');
    }
}

Send a text message

You can only send a text message after you've send a template and the user responded.

php
message('Hello, this is a test message')
            ->to('34676010101');
    }
}

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

bash
$ composer test

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Contributing

Please see CONTRIBUTING for details.

Credits

  • Álex Albarca
  • All Contributors

License

The MIT License (MIT). Please see License File for more information.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPlaravel-notification-channellaravel-whatsappphpsdk

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架