42dx / whatsapp-laravel-sdk
A laravel package that abstracts all the whatsapp api integration into an easy-to-use services and facades
Fund package maintenance!
Github-Sponsors
Patreon
Polar
Ko-Fi
Requires (Dev)
- orchestra/testbench: ^9.1
- phpunit/phpunit: ^11.2
This package is auto-updated.
Last update: 2024-11-02 18:41:42 UTC
README
This Laravel package's goal is to abstract and simplify the integration with the Facebook's Whatsapp Business API through services, facades and methods, as well properly documenting how to work with it, since it is sometimes hard to find the info you need to correctly implement the API.
Check our package on Packagist.
Project Standards
[WIP]
Project Meta Data
Project Status
[WIP]
Table of Contents
Composer Scripts
We tried to automate as much boring tasks and CLI commands as we could on short composer
scripts. Below you will find a general description of what each one does:
composer commit
: Runs thecomitzen
binary which opens an interactive CLI to keep commits in a standard that our pipeline can use to generate the package changelog automatically.composer coverage
: Run the tests and generates code coverage. If you are contributing, please make sure you do not lower the current coverage. ;)composer start
: Serves the sample application (throughphp artisan serve
) with the package already loaded. It will run the Sample App on port8000
.composer serve
: Connects to Serveo service and expose your local environment to the web. It assumes that the local app is running on port8000
.composer test
: Run the tests (do not generate coverage report)
Run and Test
We included a sample fresh Laravel app to help those who want to contribute to the package. To start it just go through the following steps:
- Clone this repository and
cd
into the sample app folder (<repository-folder>/samples/laravel-11
). - Run
composer setup
from the repository root. It willcd
on sample app's folder, install the dependencies andcd
back to the root folder. - Run
composer start
from the repository root. It will run the sample app throughartisan serve
command. - With the local server running, from another terminal run
composer serve
from the repository. It will connect to serveo service and expose your local application to the web.
Configure Whatsapp Webhook
[WIP]
Tooling
There are a few tools we provide alongside with the source code to ease a little bit the burden of following a bunch of patterns and standards we set up, as well as automate some boring processes.
Comitizen
This CLI helps with writting commit messages in a meaningful and standardized way, so that our automation process can use them to properly write our software changelog.
If you like the tool, kudo the devs ;)
How to use Comitzen
Just run composer commit
from the repository's root folder instead of the traditional git commit
and follow the CLI interactive steps :)
Sample App
For those who want to test and/or contribute to this package, we included a sample fresh laravel application with the package already locally loaded, so you can emulate a real Laravel application that uses the package :)
How to run the Sample App
Just run composer serve
from the repository's root folder. The script will cd
into the sample folder and run the Laravel artisan command php artisan serve
from there.
Serveo
This service allows routing external requests to your local environment. You can use it to test your Watsapp webooks locally while developing.
If you like the tool, kudo the devs ;)
How to use Serveo
Just run composer connect
from the repository's root folder. You will need to have our sample application running so you can receive webhook requests locally.
Contributors
Kudos to all our dear contributors. Without them, nothing would have been possible ❤️
Would you like to see your profile here? Take a look on our Code of Conduct and our Contributing docs, and start coding! We would be thrilled to review a PR of yours! 💯
Changelog
All changes made to this package since the start of development can be found either on our release list or on the changelog.
Roadmap
Any planned enhancement to the package will be described and tracked in our project page