dantaylorseo / laravel-maytapi-channel
This is my package laravel-maytapi-channel
Fund package maintenance!
dantaylorseo
Requires
- php: ^8.2
- laravel/framework: ^10.0||^11.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.3
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
This package is auto-updated.
Last update: 2025-08-25 14:23:23 UTC
README
This package provides a notification channel for Laravel that sends WhatsApp messages using the Maytapi API.
Installation
You can install the package via composer:
composer require dantaylorseo/laravel-maytapi-channel
You can publish the config file with:
php artisan vendor:publish --tag="laravel-maytapi-channel-config"
This is the contents of the published config file:
return [ 'api_key' => env('MAYTAPI_API_KEY'), 'product_id' => env('MAYTAPI_PRODUCT_ID'), 'phone_id' => env('MAYTAPI_PHONE_ID'), 'send_to_channel' => env('MAYTAPI_SEND_TO_CHANNEL', false), // if set to true, messages will be sent to the channel instead of the user 'group_id' => env('MAYTAPI_GROUP_ID'), // if the message is being sent to a group, this is the group ID ];
Usage
This channel uses the toMail()
method on the notification class to determine the outgoing message. line()
and action()
methods are supported.
To set the phone number to send the message to, add the routeNotificationForMaytapi
method to your Notifiable
model.
public function routeNotificationForMaytapi() { return $this->phone_number; // in the format 447123456789 (country code followed by the number, no leading 0, no spaces) }
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.