draganus / laravel-notification-preferences

用户可以:启用/禁用电子邮件地址、推送通知、短信、Slack等通知

0.0.1 2021-12-02 12:31 UTC

This package is auto-updated.

Last update: 2024-09-11 04:09:29 UTC


README

Latest Version on Packagist GitHub Code Style Action Status Total Downloads

支持我

你可以请我喝杯咖啡 ☕️.

安装

您可以通过composer安装此包

composer require draganus/laravel-notification-preferences

您可以使用以下命令发布和运行迁移

php artisan vendor:publish --provider="draganus\LaravelNotificationPreferences\LaravelNotificationPreferencesServiceProvider"
php artisan migrate

这是发布配置文件的内容

return [
    /*
     * Set the defoult notification's delivery channels
     */
    "notify_channels" => ['mail', 'database']
];

用法

在您的Notification类中通过方法替换

public function via($notifiable) 
{
    $notificationPreference = new NotificationPreference();
    return $notificationPreference->check($notifiable, self::class);
}

测试

composer test

变更日志

请参阅CHANGELOG以获取最近更改的更多信息。

贡献

请参阅CONTRIBUTING以获取详细信息。

安全漏洞

请审查我们的安全策略,了解如何报告安全漏洞。

鸣谢

许可证

MIT许可证(MIT)。请参阅许可证文件以获取更多信息。