Weave 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

Chat Bundle Laravel Package

cunningsoft/chat-bundle

View on GitHub
Deep Wiki
Context7

Build Status

Installation

  1. Add the following to your composer.json file:

    // composer.json
    {
        // ...
        require: {
            // ...
            "cunningsoft/chat-bundle": "0.5.*"
        }
    }
    
  2. Run composer update cunningsoft/chat-bundle to install the new dependencies.

  3. Register the new bundle in your AppKernel.php: (note, that you also need to add the KnpTimeBundle here)

    <?php
    // in AppKernel::registerBundles()
    $bundles = array(
        // ...
        new Cunningsoft\ChatBundle\CunningsoftChatBundle(),
        new Knp\Bundle\TimeBundle\KnpTimeBundle(),
        // ...
    );
    
  4. Let your user entity implement the Cunningsoft\ChatBundle\Entity\AuthorInterface:

    // Acme\ProjectBundle\Entity\User.php
    <?php
    
    namespace Acme\ProjectBundle\Entity;
    
    use Cunningsoft\ChatBundle\Entity\AuthorInterface;
    
    class User implements AuthorInterface
    {
        // ...
    
  5. Map the interface to your user entity in your config.yml:

    // app/config/config.yml
    // ...
    doctrine:
        orm:
            resolve_target_entities:
                Cunningsoft\ChatBundle\Entity\AuthorInterface: Acme\ProjectBundle\Entity\User
    
  6. Update your database schema:

    $ app/console doctrine:schema:update
    
  7. Configure the chat bundle:

    // app/config/config.yml
    // ...
    cunningsoft_chat:
        # refresh interval in milliseconds
        update_interval: 5000
        # messages to be shown in chat
        number_of_messages: 10
    
  8. Import routes:

    // app/config/routing.yml
    // ...
    cunningsoft_chat_bundle:
        resource: "@CunningsoftChatBundle/Controller"
        type: annotation
    
  9. Render the chat in your template:

    // src/Acme/ProjectBundle/Resources/views/Default/index.html.twig
    // ...
    {% render(controller('CunningsoftChatBundle:Chat:show')) %}
    // ...
    

Changelog

  • 0.5 (master) Support for newer Symfony versions

  • 0.4 Upgrade to Symfony 2.3.* - dropped support for Symfony 2.2.*

  • 0.3 Included "Cunningsoft" into the namespace to avoid conflicts

  • 0.2 Upgrade to Symfony 2.2.* - dropped support for Symfony 2.1.*

  • 0.1 First working version. Support for Symfony 2.1.*

Notes

Please also visit my Open Source Browsergame Project Open Soccer Star.

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.
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast