定制 john-wink/jw-notifications 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

john-wink/jw-notifications

最新稳定版本:1.0.3

Composer 安装命令:

composer require john-wink/jw-notifications

包简介

Filament Plugin for customizable Notification Channels per User

README 文档

README

With this Plugin you can customize the Notifications Channel per User

Installation

You can install the package via composer:

composer require john-wink/jw-notifications

You can publish and run the migrations with:

php artisan vendor:publish --tag="jw-notifications-migrations"
php artisan migrate

You can publish the config file with:

php artisan vendor:publish --tag="jw-notifications-config"

Optionally, you can publish the views using

php artisan vendor:publish --tag="jw-notifications-views"

This is the contents of the published config file:

return [
    'table'      => 'subscribed_channels',
    'notifiable' => App\Models\User::class,
];

Usage

Replace the via() function within Notifications that you want to use with this trait:

    use \JohnWink\JwNotifications\Traits\HasCustomizedChannels;

Add the following trait to the user:

    use \JohnWink\JwNotifications\Traits\CanSubscribeToChannels;

Configure the FilamentPanels according to this example: Replace the notifications with your own notifications and the channels with your own channels that you have installed and configured.

return $panel->plugins([
    JwNotificationsPlugin::make()
        ->notifications([
            /*
            * Add here your Notifications Channels
            * The Notification Channel should use the Trait: 
            * \JohnWink\JwNotifications\Traits\HasCustomizedChannels
            */
        ])
        ->channels(fn () => [
            'database'        => 'Database',
            'mail'            => 'Email',
        ]),
    ]);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 9.57k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-16