molnix/laravel-nextcloud-talk-channel
最新稳定版本:v1.0.1
Composer 安装命令:
composer require molnix/laravel-nextcloud-talk-channel
包简介
A Laravel notification channel for Nextcloud Talk
README 文档
README
This package makes it easy to send notifications using NextcloudTalk with Laravel 10.x, 11.x and 12.x.
Contents
Installation
You can install this package via composer:
composer require molnix/laravel-nextcloud-talk-channel
Setting up the NextcloudTalk service
Add your NextcloudTalk config to config/services.php:
// config/services.php ... 'nextcloudtalk' => [ 'url' => env('NEXTCLOUD_URL'), 'username' => env('NEXTCLOUD_USERNAME'), 'password' => env('NEXTCLOUD_PASSWORD'), 'default_channel' => env('NEXTCLOUD_DEFAULT_CHANNEL'), 'one_to_one_channel_name' => env('NEXTCLOUD_ONE_TO_ONE_CHANNEL_NAME'), ], ...
Usage
You can use the channel in your via() method inside the notification:
use Illuminate\Notifications\Notification; use Molnix\Channels\NextcloudTalkChannel; use Molnix\Channels\NextcloudTalkMessage; class NextcloudNotification extends Notification { public function via(object $notifiable): array { return [NextcloudTalkChannel::class]; } public function toNextcloudTalk() { return NextcloudTalkMessage::create('Hello'); } }
If you want the bot to make a channel with the user and send message (one to one), add routeNotificationForNextcloudTalk to your notifiable model:
public function routeNotificationForNextcloudTalk($notification): string { return $this->username; }
Channel selection order:
- Channel specified using
NextcloudTalkMessage::to(). routeNotificationForNextcloudTalk()default_channelspecified in the config
Available Message methods
to(): To specify a nextcloud channel token, example groups etc.
content(): Sets a content of the notification message.
Testing
$ composer test
Security
If you discover any security related issues, please email vishnu@monlnix.com or johan@molnix.com instead of using the issue tracker.
Contributing
You are welcome to contribute
Credits
License
The MIT License (MIT). Please see License File for more information.
Made with ❤ in Finland with Molnix
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-27