src/Subscriptions/Broadcasters/PusherBroadcaster.php
public function hook(Request $request): JsonResponse
    {
        (new Collection($request->input('events', [])))
            ->filter(function ($event): bool {
                return Arr::get($event, 'name') === 'channel_vacated';
            })
            ->each(function (array $event): void {
                $this->storage->deleteSubscriber(
                    Arr::get($event, 'channel')
                );
            });

        return response()->json(['message' => 'okay']);
    }
public function hook(Request $request): JsonResponse
    {
        (new Collection($request->input('events', [])))
            ->filter(function ($event): bool {
                return Arr::get($event, 'name') === 'channel_vacated';
            })
            ->each(function (array $event): void {
                $this->storage->deleteSubscriber(
                    Arr::get($event, 'channel')
                );
            });

        return response()->json(['message' => 'okay']);
    }
public function hook ( Request $ request ) : JsonResponse { ( new Collection ( $ request -> input ( 'events' , [ ] ) ) ) -> filter ( function ( $ event ) : bool { return Arr :: get ( $ event , 'name' ) === 'channel_vacated' ; } ) -> each ( function ( array $ event ) : void { $ this -> storage -> deleteSubscriber ( Arr :: get ( $ event , 'channel' ) ) ; } ) ; return response ( ) -> json ( [ 'message' => 'okay' ] ) ; }
Handle subscription web hook.

@param  \Illuminate\Http\Request  $request
@return \Illuminate\Http\JsonResponse
Handle subscription web hook .