Send Whatsapp messages using Twilio and native filament Notification Facade class
tomatophp/filament-twilio is a Laravel package for send whatsapp messages using twilio and native filament notification facade class.
It currently has 11 GitHub stars and 2.402 downloads on Packagist (latest version v1.0.1).
Install it with composer require tomatophp/filament-twilio.
Discover more Laravel packages by tomatophp
or browse all Laravel packages to compare alternatives.
Last updated

Send Whatsapp messages using Twilio and native filament Notification Facade class

composer require tomatophp/filament-twilio
first of all you need to add this variables to your .env file
TWILIO_SID=
TWILIO_TOKEN=
TWILIO_SENDER_NUMBER=
then clear you cache
php artisan config:cache
now on your User model add this trait
use TomatoPHP\FilamentTwilio\Traits\InteractsWithTwilioWhatsapp;
class User extends Authenticatable
{
use InteractsWithTwilioWhatsapp;
}
now you are ready to use the notification
\Filament\Notifications\Notification::make()
->body('Your Message You Like To Send Here!')
->sendToTwilioWhatsapp(
user: $user,
mediaURL: "https://images.unsplash.com/photo-1545093149-618ce3bcf49d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=668&q=80"
);
or you can use it from user model direct
$user->notifyTwilioWhatsapp(
message: 'Your Message You Like To Send Here!',
mediaURL: "https://images.unsplash.com/photo-1545093149-618ce3bcf49d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=668&q=80"
);
you can publish config file by use this command
php artisan vendor:publish --tag="filament-twilio-config"
Checkout our Awesome TomatoPHP