...
/**
* Route notifications for the Telegram channel.
*
* @return int
*/
public function routeNotificationForChatAPI()
{
return $this->phone;
}
...
php
use NotificationChannels\ChatAPI\ChatAPIChannel;
use NotificationChannels\ChatAPI\ChatAPIMessage;
use Illuminate\Notifications\Notification;
class InvoicePaid extends Notification
{
public function via($notifiable)
{
return [ChatAPIChannel::class];
}
public function toChatAPI($notifiable)
{
return ChatAPIMessage::create()
->to($notifiable->phone) // your user phone
->file('/path/to/file','My Photo.jpg')
->content('Your invoice has been paid');
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.