nahid / talk-example

This project is demo for Laravel-Talk package and its also Docker ready
http://github.com/nahid/talk
131 stars 77 forks source link

Help in installing on a real project #17

Closed catumd closed 7 years ago

catumd commented 7 years ago

Hi, thank for your job, this repository in full satisfy the need for my project bad one problem I don't know how to install this example in my project, I tried but brought this error to the main screen InvalidArgumentException in AuthManager.php line 86: Auth guard [user] is not defined. what to do? How can I insert talk-example into my applications?

nahid commented 7 years ago

If you want to develop messaging system please integrate http://github.com/nahid/talk with your system.

Talk-Example is a demo project for Talk

catumd commented 7 years ago

@nahid, Yes, but I don't experience in creating a real-time chat because I try using this example. But this example using Laravel 5.3 and unfortunately my project using Laravel 5.4. Thank you for your attention.

catumd commented 7 years ago

@nahid good I did, I add in MessageController.php in public function __construct() this code `$this->middleware(function ($request, $next) { Talk::setAuthUserId(Auth::user()->id); return $next($request); });

    View::composer('partials.peoplelist', function ($view) {
        $threads = Talk::threads();
        $view->with(compact('threads'));
    });` and everything turned out. 
nahid commented 7 years ago

You can use Talk Middleware for laravel 5.3+

register this middleware in app/Http/Kernel.php in routeMiddleware section

'talk'  =>  \Nahid\Talk\Middleware\TalkMiddleware::class,
catumd commented 7 years ago

That's exactly what I did.