diff --git a/.github/ISSUE_TEMPLATE/1_Bug_report.md b/.github/ISSUE_TEMPLATE/1_Bug_report.md deleted file mode 100644 index 5344120e..00000000 --- a/.github/ISSUE_TEMPLATE/1_Bug_report.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -name: "Bug report" -about: "Report something that's broken. Please ensure your version is still supported: https://laravel.com/docs/releases#support-policy" ---- - - - - -- Echo Version: #.#.# -- Laravel Version: #.#.# -- PHP Version: #.#.# -- NPM Version: #.#.# -- Node Version: #.#.# - -### Description: - - -### Steps To Reproduce: - - - diff --git a/.github/ISSUE_TEMPLATE/1_Bug_report.yml b/.github/ISSUE_TEMPLATE/1_Bug_report.yml new file mode 100644 index 00000000..913887a7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1_Bug_report.yml @@ -0,0 +1,55 @@ +name: Bug Report +description: "Report a general library issue." +body: + - type: markdown + attributes: + value: "Before submitting your report, [please ensure your Laravel version is still supported](https://laravel.com/docs/releases#support-policy)." + - type: input + attributes: + label: Echo Version + description: Provide the Echo version that you are using. + placeholder: 1.15.0 + validations: + required: true + - type: input + attributes: + label: Laravel Version + description: Provide the Laravel version that you are using. + placeholder: 10.4.1 + validations: + required: true + - type: input + attributes: + label: PHP Version + description: Provide the PHP version that you are using. + placeholder: 8.1.4 + validations: + required: true + - type: input + attributes: + label: NPM Version + description: Provide the NPM version that you are using. + placeholder: 7.2.3 + validations: + required: true + - type: input + attributes: + label: Database Driver & Version + description: If applicable, provide the database driver and version you are using. + placeholder: "MySQL 8.0.31 for macOS 13.0 on arm64 (Homebrew)" + validations: + required: false + - type: textarea + attributes: + label: Description + description: Provide a detailed description of the issue you are facing. + validations: + required: true + - type: textarea + attributes: + label: Steps To Reproduce + description: Provide detailed steps to reproduce your issue. If necessary, please provide a GitHub repository to demonstrate your issue using `laravel new bug-report --github="--public"`. + validations: + required: true + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 82d5fcff..b2fdd592 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ # Release Notes -## [Unreleased](https://github.com/laravel/echo/compare/v1.14.2...master) +## [Unreleased](https://github.com/laravel/echo/compare/v1.15.0...master) + +## [v1.15.0](https://github.com/laravel/echo/compare/v1.14.2...v1.15.0) - 2023-01-17 + +### Added + +- Leave from all channels by @k0mar12 in https://github.com/laravel/echo/pull/365 +- Add an `encrypedPrivateChannel` function to the NullConnector. by @luniki in https://github.com/laravel/echo/pull/369 +- Add a `listenToAll` function to the NullConnector. by @luniki in https://github.com/laravel/echo/pull/368 ## [v1.14.2](https://github.com/laravel/echo/compare/v1.14.1...v1.14.2) - 2022-11-22 diff --git a/package.json b/package.json index 14004c1f..4365a489 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "laravel-echo", - "version": "1.15.0", + "version": "1.15.1", "description": "Laravel Echo library for beautiful Pusher and Socket.IO integration", "keywords": [ "laravel", diff --git a/src/channel/null-presence-channel.ts b/src/channel/null-presence-channel.ts index cc4bea38..18ca9b94 100644 --- a/src/channel/null-presence-channel.ts +++ b/src/channel/null-presence-channel.ts @@ -20,16 +20,16 @@ export class NullPresenceChannel extends NullChannel implements PresenceChannel } /** - * Listen for someone leaving the channel. + * Send a whisper event to other clients in the channel. */ - leaving(callback: Function): NullPresenceChannel { + whisper(eventName: string, data: any): NullPresenceChannel { return this; } /** - * Trigger client event on the channel. + * Listen for someone leaving the channel. */ - whisper(eventName: string, data: any): NullPresenceChannel { + leaving(callback: Function): NullPresenceChannel { return this; } } diff --git a/src/channel/null-private-channel.ts b/src/channel/null-private-channel.ts index b3a78327..e6221779 100644 --- a/src/channel/null-private-channel.ts +++ b/src/channel/null-private-channel.ts @@ -5,7 +5,7 @@ import { NullChannel } from './null-channel'; */ export class NullPrivateChannel extends NullChannel { /** - * Trigger client event on the channel. + * Send a whisper event to other clients in the channel. */ whisper(eventName: string, data: any): NullPrivateChannel { return this; diff --git a/src/channel/presence-channel.ts b/src/channel/presence-channel.ts index 6566898b..1b0ec302 100644 --- a/src/channel/presence-channel.ts +++ b/src/channel/presence-channel.ts @@ -14,6 +14,11 @@ export interface PresenceChannel extends Channel { */ joining(callback: Function): PresenceChannel; + /** + * Send a whisper event to other clients in the channel. + */ + whisper(eventName: string, data: any): PresenceChannel; + /** * Listen for someone leaving the channel. */ diff --git a/src/channel/pusher-encrypted-private-channel.ts b/src/channel/pusher-encrypted-private-channel.ts index 23f303f2..edc82c4c 100644 --- a/src/channel/pusher-encrypted-private-channel.ts +++ b/src/channel/pusher-encrypted-private-channel.ts @@ -5,7 +5,7 @@ import { PusherChannel } from './pusher-channel'; */ export class PusherEncryptedPrivateChannel extends PusherChannel { /** - * Trigger client event on the channel. + * Send a whisper event to other clients in the channel. */ whisper(eventName: string, data: any): PusherEncryptedPrivateChannel { this.pusher.channels.channels[this.name].trigger(`client-${eventName}`, data); diff --git a/src/channel/pusher-presence-channel.ts b/src/channel/pusher-presence-channel.ts index 86af7080..7c70c523 100644 --- a/src/channel/pusher-presence-channel.ts +++ b/src/channel/pusher-presence-channel.ts @@ -28,21 +28,21 @@ export class PusherPresenceChannel extends PusherChannel implements PresenceChan } /** - * Listen for someone leaving the channel. + * Send a whisper event to other clients in the channel. */ - leaving(callback: Function): PusherPresenceChannel { - this.on('pusher:member_removed', (member) => { - callback(member.info); - }); + whisper(eventName: string, data: any): PusherPresenceChannel { + this.pusher.channels.channels[this.name].trigger(`client-${eventName}`, data); return this; } /** - * Trigger client event on the channel. + * Listen for someone leaving the channel. */ - whisper(eventName: string, data: any): PusherPresenceChannel { - this.pusher.channels.channels[this.name].trigger(`client-${eventName}`, data); + leaving(callback: Function): PusherPresenceChannel { + this.on('pusher:member_removed', (member) => { + callback(member.info); + }); return this; } diff --git a/src/channel/pusher-private-channel.ts b/src/channel/pusher-private-channel.ts index ad67e571..9158449d 100644 --- a/src/channel/pusher-private-channel.ts +++ b/src/channel/pusher-private-channel.ts @@ -5,7 +5,7 @@ import { PusherChannel } from './pusher-channel'; */ export class PusherPrivateChannel extends PusherChannel { /** - * Trigger client event on the channel. + * Send a whisper event to other clients in the channel. */ whisper(eventName: string, data: any): PusherPrivateChannel { this.pusher.channels.channels[this.name].trigger(`client-${eventName}`, data); diff --git a/src/channel/socketio-presence-channel.ts b/src/channel/socketio-presence-channel.ts index 879c1261..96e46dd5 100644 --- a/src/channel/socketio-presence-channel.ts +++ b/src/channel/socketio-presence-channel.ts @@ -25,6 +25,19 @@ export class SocketIoPresenceChannel extends SocketIoPrivateChannel implements P return this; } + /** + * Send a whisper event to other clients in the channel. + */ + whisper(eventName: string, data: any): SocketIoPresenceChannel { + this.socket.emit('client event', { + channel: this.name, + event: `client-${eventName}`, + data: data, + }); + + return this; + } + /** * Listen for someone leaving the channel. */ diff --git a/src/channel/socketio-private-channel.ts b/src/channel/socketio-private-channel.ts index 0674e61f..102da067 100644 --- a/src/channel/socketio-private-channel.ts +++ b/src/channel/socketio-private-channel.ts @@ -5,7 +5,7 @@ import { SocketIoChannel } from './socketio-channel'; */ export class SocketIoPrivateChannel extends SocketIoChannel { /** - * Trigger client event on the channel. + * Send a whisper event to other clients in the channel. */ whisper(eventName: string, data: any): SocketIoChannel { this.socket.emit('client event', {