简体   繁体   中英

Laravel workbench real-time chat

I am followed up this guide ' https://medium.com/laravel-4/laravel-4-real-time-chat-eaa550829538 ', to create real-time chat in my app. All was alright, before "workbench" moment. I created "formativ/chat" workbench with composer, then created and fill files. After, i run "composer update" in

'workbench/formativ/chat'

directory and added

'Formativ\\Chat\\ChatServiceProvider'

to app.php. But then 'ember.js' just throw error in console

'can't establish a connection to the server at ws://127.0.0.1:7778/.'

and nothing worked. Also if i'll write not-valide php code in

workbench/formativ/chat/chat/command/Server.php

laravel will no throw any error

Update

I finally got 'ServiceProvider' to work. But other files didn't work. I connected them to ServiceProvider with

$this->app->bind("chat.chat", function()
{
        return new Chat(
            $this->app->make("chat.emitter")
        );
});

In my workbench i have this architecture

workbench_folder->vendor/appname/src/vendom/appname/

Command\Serve.php
Chat.php
ChatInterface.php
ChatServiceProvider.php
User.php
UserInterface.php

Just typed "php artisan chat:serve" and all works. Not found it in tutorial

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM