coreproc/nova-echo
Composer 安装命令:
composer require coreproc/nova-echo
包简介
Adds Laravel Echo with your broadcast configuration to your Laravel Nova app
README 文档
README
Adds Laravel Echo with your broadcast configuration to your Laravel Nova app.
Installation
By using Nova Echo, we have a readily configured Laravel Echo instance in our JS.
Here are suggested options for broadcasting/receiving using websockets:
You can find instructions about setting up broadcasting in Laravel using the official documentation.
Once you have this set up in your Nova app, you can install this package via composer
composer require coreproc/nova-echo
You will then need to override Nova's layout.blade.php. Create a layout file resources/views/vendor/nova/layout.blade.php and copy the contents from vendor/laravel/nova/resources/views/layout.blade.php.
Include Nova Echo's blade file in the Nova layout. This blade file contains meta tags with your broadcast configuration.
// file: resources/views/vendor/nova/layout.blade.php <!DOCTYPE html> <html lang="en" class="h-full font-sans antialiased"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=1280"> <meta name="csrf-token" content="{{ csrf_token() }}"> @include('nova-echo::meta') <!-- Include this line --> <title> ...
Usage
Nova Echo instantiates Echo and makes it available throughout your Nova app. You can access your Echo object through
window.Echo
By default, this Echo instance already subscribes to the logged in user's private channel, which by default would be the namespace of your app's user object, ie. App.User.{id}.
You can access and attach listeners to this user's private channel through
window.userPrivateChannel
To authenticate the user through this channel, make sure you have your BroadcastServiceProvider available with Broadcast::routes() declared. You'll also need to define access through your route/channels.php file, ie:
// file: routes/channels.php Broadcast::channel('App.User.{id}', function ($user, $id) { return (int)$user->id === (int)$id; });
You can override the receivesBroadcastNotificationsOn to use a different channel name.
class User extends Authenticatable { use Notifiable; ... /** * The channels the user receives notification broadcasts on. * * @return string */ public function receivesBroadcastNotificationsOn() { return 'users.' . $this->id; } }
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email chris.bautista@coreproc.ph instead of using the issue tracker.
Credits
About CoreProc
CoreProc is a software development company that provides software development services to startups, digital/ad agencies, and enterprises.
Learn more about us on our website.
License
The MIT License (MIT). Please see License File for more information.
coreproc/nova-echo 适用场景与选型建议
coreproc/nova-echo 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 98.43k 次下载、GitHub Stars 达 19, 最近一次更新时间为 2019 年 02 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「real-time」 「nova」 「WebSockets」 「laravel」 「echo」 「Broadcasting」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 coreproc/nova-echo 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 coreproc/nova-echo 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 coreproc/nova-echo 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova card that shows you your system information.
A Laravel Nova card.
Talk is a Laravel based realtime messaging, chatting and conversation system. It helps to develop users messaging, chatting and conversations in easy way.
A Laravel Nova package for publishable fields
A Laravel Nova package for translatable fields
Thruway WAMP router core
统计信息
- 总下载量: 98.43k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 19
- 点击次数: 40
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-02-05