定制 osp-pawan/pusherbyrepository 二次开发

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

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

osp-pawan/pusherbyrepository

Composer 安装命令:

composer require osp-pawan/pusherbyrepository

包简介

This will send notification using pusher via repository

README 文档

README

This package will help you to send notification using pusher via repository pattern code

Installation

$ composer require osp-pawan/pusherbyrepository

Service Provider & Facade (Optional on Laravel 5.5+)

Register provider and facade on your config/app.php file.

'providers' => [
    ...,
    OspPawan\PusherByRepository\PusherByRepositoryServiceProvider::class,
    //Uncomment below line from your `config/app.php`
    App\Providers\BroadcastServiceProvider::class,
]

.env File changes

When Composer is done, we will need to configure Laravel to use Pusher as its broadcast driver, to do this, open the .env file that is in the root directory of your Laravel installation. Update the values to correspond with the configuration below:

    BROADCAST_DRIVER=pusher

    // Get the credentials from your pusher dashboard
    PUSHER_APP_ID=XXXXX
    PUSHER_APP_ID=XXXXX
    PUSHER_APP_KEY=XXXXXXX
    PUSHER_APP_SECRET=XXXXXXX

Simple Example

Must use below constructor in order to use PusherRepository

<?php

    use OspPawan\PusherByRepository\PusherRepository;

    private $pusherRepository;

    public function __construct(PusherRepository $pusherRepository){
        $this->pusherRepository = $pusherRepository;
    }

Send boadcast notification to every user by using below line in the function

    $this->pusherRepository->broadcastNotification('Send you message here');

After sending you Broadcast Notification you can see all the notification here run php artisan serve --port=8001 and open http://127.0.0.1:8001/test-pusher

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固