https://github.com/gabrielesbaiz/whatsapp-toolkit
A helper package to handle WhatsApp messages using api.whatsapp.com
https://github.com/gabrielesbaiz/whatsapp-toolkit
laravel-package php
Last synced: 3 months ago
JSON representation
A helper package to handle WhatsApp messages using api.whatsapp.com
- Host: GitHub
- URL: https://github.com/gabrielesbaiz/whatsapp-toolkit
- Owner: gabrielesbaiz
- License: mit
- Created: 2025-03-01T07:02:12.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-03-02T18:24:28.000Z (3 months ago)
- Last Synced: 2025-03-02T19:27:24.975Z (3 months ago)
- Topics: laravel-package, php
- Language: PHP
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# WhatsappToolkit
[](https://packagist.org/packages/gabrielesbaiz/whatsapp-toolkit)
[](https://packagist.org/packages/gabrielesbaiz/whatsapp-toolkit)A lightweight helper package to handle WhatsApp messages using api.whatsapp.com
## Features
- ✅ URL generator for api.whatsapp.com
- ✅ Message formatter from HTML to WhatsApp
- ✅ PhoneNumber formatter## Installation
You can install the package via composer:
```bash
composer require gabrielesbaiz/whatsapp-toolkit
```Laravel will automatically register the service provider and facades.
If necessary, you can manually add the service provider in `config/app.php`:
```bash
'providers' => [
Gabrielesbaiz\WhatsappToolkit\WhatsappToolkitServiceProvider::class,
],
```
And the facades:```bash
'aliases' => [
'WhatsappToolkit' => Gabrielesbaiz\WhatsappToolkit\Facades\WhatsappToolkit::class,
],
```## Usage
```php
$whatsappToolkit = new Gabrielesbaiz\WhatsappToolkit();echo $whatsappToolkit->url('+39 1234567890', '
Hallo world!
'); // https://api.whatsapp.com/send?phone=%2B39+1234567890&text=Hallo+world%21
```Using facade:
```php
use WhatsappToolkit;WhatsappToolkit::url('+39 1234567890', '
Hallo world!
'); // https://api.whatsapp.com/send?phone=%2B39+1234567890&text=Hallo+world%21
WhatsappToolkit::formatMessage('Hallo world!
'); // Hallo+world%21
WhatsappToolkit::formatPhoneNumber('+39 1234567890'); // %2B39+1234567890
```## Testing
```bash
composer test
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Gabriele Sbaiz](https://github.com/gabrielesbaiz)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.