santran / browsernotifications
集成浏览器通知至Laravel 5.2及以上版本。
dev-master
2018-04-21 14:29 UTC
Requires
- php: >=5.5.9
This package is not auto-updated.
Last update: 2024-09-28 20:56:04 UTC
README
安装(Laravel)
通过composer安装
composer require santran/browsernotifications:dev-master
将服务提供者添加到config/app.php
文件中的providers
部分
SanTran\BrowserNotifications\BrowserNotificationsProvider::class
发布配置文件和视图文件,打开控制台并输入以下命令
php artisan vendor:publish
配置文件 'browsernotifications.php' : 版本变更
如何使用?打开您的布局文件并添加js到视图中。
@include("browsernotifications.browsernotifications")
调用js以显示通知
$(document).ready(function () { showNotification(title, content, url, icon); });