laravel-swoole: Auth error in laravel 5.8 with swoole 2.6

Make sure you read Issues Guideline and answer these questions before submitting your issue. Thanks! (Any non-English issues will be closed immediately.)

  1. Please provide your PHP and Swoole version. (php -v and php --ri swoole) PHP 7.2.24-0ubuntu0.18.04.2 (cli) (built: Jan 13 2020 18:39:59) ( NTS ) Version => 4.4.15

  2. Please provide your Laravel/Lumen version. Laravel: 5.8

  3. Which release version of this package are you using? 2.6

  4. What did you do? If possible, provide a recipe for reproducing the error.

Websocket::on('connect',function($websocket,$request){
var_dump($request->user());
});
  1. What did you expect to see? User function

  2. What did you see instead? NULL!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22 (12 by maintainers)

Most upvoted comments

@MostafaRabia can you share your swoole_http and swoole_websocket config files? And check that your config contains the following lines in the “providers” section:

    /*
    |--------------------------------------------------------------------------
    | Providers here will be registered on every request.
    |--------------------------------------------------------------------------
    */
    'providers' => [
        Illuminate\Auth\AuthServiceProvider::class,
        App\Providers\AuthServiceProvider::class,