infinety-es/notifications 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

infinety-es/notifications

Composer 安装命令:

composer require infinety-es/notifications

包简介

Notification messages system

README 文档

README

Latest Version on Packagist Total Downloads Software License StyleCI

A package to manage Notifications

With this package you can send notifications to your model. You can choose if you want users, or whatever model.

Notifications are saved on notifications and each item of your model can retrieve it. Also you can set each notification as read.

Installation

Install via composer: composer require infinety-es\notifications

Then register the service provider in config/app.php inside providers array:

Infinety\Notifications\NotificationsServiceProvider::class,

Publish package files:

php artisan vendor:publish --provider="Infinety\Notifications\NotificationsServiceProvider"

Tip: You can also publish only this tags: config, views and migrations

After modify config\notifications.php file NotificationTraitto your model. For example User model:

<?php
namespace App;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Infinety\Notifications\Traits\NotificationTrait;

class User extends Authenticatable
{

    use NotificationTrait;

Use

In your browser go to notifications. Example: www.infinety.app/notifications.

Default pages are in resources\views\vendor\notifications. You can view and create notifications with a simple interface. You can modify everything.

Command

You can create notifications by artisan with command:

php artisan notifications:new

You have some options you need to add. If not, the command will ask you. Options are:

--notify[=NOTIFY]    A model ID, or all
--subject[=SUBJECT]  Notification subject
--message[=MESSAGE]  Notification message
--type[=TYPE]        Type of notifications defined in config file

Trait Methods

Get all notifications

    /**
     * Get All Notifications. Readed or not
     *
     * @return Eloquent
     */
    public function notifications()

This method retrieves all notifications read and not read notifications

Get not read notifications

    /**
     * Get not read notifications
     *
     * @return Eloquent
     */
     public function getNotReadNotifications()

This method retrieves not read notifications

Get read notifications

    /**
     * Get read Notifications
     *
     * @return Eloquent
     */
    public function getReadNotifications()

This method retrieves read notifications. It's great if you want to show history.

Get count of all notifications

    /**
     * Get Count of all Notifications
     *
     * @return integer
     */
    public function getAllNotificationCount()

Get count of all notifications including read and not read.

Get count of not read notifications

    /**
     * Get Count of not read Notifications
     *
     * @return integer
     */
    public function getNotReadNotificationCount()

Get count of all notifications not read.

Contributing

All contributions (in the form on pull requests, issues and feature-requests) are welcome. See the contributors page for all contributors.

##License

Laravel 5 Notifications is an open-sourced laravel package licensed under the MIT License (MIT). Please see the license file for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-06-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固