承接 mallardduck/dynamic-echo-events 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

mallardduck/dynamic-echo-events

Composer 安装命令:

composer require mallardduck/dynamic-echo-events

包简介

A library that allows registering laravel-echo events dynamically and done entirely in PHP.

README 文档

README

Travis Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version License Coveralls Coverage Status Code Intelligence Status

A helper library to dynamically generate the javascript to register Echo event listeners.

Instead of manually writing JS code to register Echo event listeners, simply define the JS handler callback in the Event. Then add the ImplementsDynamicEcho contact and use the PrivateDynamicEchoChannel trait.

Installation

You can install the package via composer:

composer require mallardduck/dynamic-echo-events

You can publish the config file with:

php artisan vendor:publish --provider="MallardDuck\DynamicEcho\DynamicEchoServiceProvider" --tag="config"

This is the contents of the published config file:

return [
    'namespace' => env('DYNAMIC_ECHO_NS', 'App\\Events')
];

Usage

First, you will need to make sure that your site's app.js file properly configures the Echo javascript client. This ensures the generated code has the necessary requirements.

Then, modify your sites base theme files to load the dynamic echo generated javascript. This should be done at a point in the template where the main app.js is loaded.

Add in:

@dynamicEcho

Finally, when you want an event to automatically register itself in the browser use the Event contact and trait. This is done simply by adding the ImplementsDynamicEcho contact and use the PrivateDynamicEchoChannel trait to the event.

Check the examples folder for working example(s) of how this is done.

Testing

composer test

Changelog

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

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-11-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固