Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Ratchet Bundle Laravel Package

ad3n/ratchet-bundle

Symfony bundle integrating Ratchet WebSockets. Define a MessageProcessor service (tag ihsan_ratchet.message_processor) to handle client messages, configure WEB_SOCKET_PORT/ihsan_ratchet.web_socket_port, then start the server with ihsan:server:start.

View on GitHub
Deep Wiki
Context7

Ihsan Ratchet Bundle

Install

composer req ad3n/ratchet-bundle

Activating Bundle (Optional)

Add new Ihsan\RatchetBundle\IhsanRatchetBundle() in your AppKernel.php

Create Your Message Processor

<?php

namespace YourBundle\Message\Processor;

use Ihsan\RatchetBundle\Message\Message;
use Ihsan\RatchetBundle\Processor\MessageProcessorInterface;
use Ratchet\ConnectionInterface;

/**
 * @author Muhamad Surya Iksanudin <surya.kejawen@gmail.com>
 */
class MyOwnMessageProcessor implements MessageProcessorInterface
{
    /**
     * @param ConnectionInterface $connection
     * @param Message $message
     *
     * @return Message
     */
    public function process(ConnectionInterface $connection, Message $message): Message
    {
        //$message is message send by the client
        //Your Own Logic
        
        return $message;//return original message or
        
        //return new Message(json_encode(['message' => 'Hello', 'more_data_to_expose' => $data]));
    }
}

Create Service

You must add tag ihsan_ratchet.message_processor to register your own message processor

    YourBundle\Message\Processor\MyOwnMessageProcessor:
        tags:
            - { name: 'ihsan_ratchet.message_processor' }

Add Configuration Key

WEB_SOCKET_PORT=7777

or

ihsan_ratchet:
    web_socket_port: 7777

Start Server

Run php bin/console ihsan:server:start

Full Documention

Socketo.me

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge