molnix/laravel-nextcloud-talk-channel

A Laravel notification channel for Nextcloud Talk

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/molnix/laravel-nextcloud-talk-channel

v1.0.0 2025-10-27 11:51 UTC

This package is auto-updated.

Last update: 2025-10-27 11:52:01 UTC


README

Tests

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:

  1. Channel specified using NextcloudTalkMessage::to().
  2. routeNotificationForNextcloudTalk()
  3. default_channel specified 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@koothattu.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