Laravel -swoole websocket вызван в другой команде - PullRequest
0 голосов
/ 06 февраля 2020

Я создал команду laravel с laravel -swoole, где я отправляю веб-сокет клиенту, который я использую laravel -swoole https://github.com/swooletw

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use SwooleTW\Http\Websocket\Facades\Websocket;

class TestCommandSendSocketData extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'test:send';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Test Send';

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        Websocket::broadcast()->emit('test', 'test data');

    }
}

но когда я запускаю команду php artisan test:send, я всегда получаю сообщение об ошибке Illuminate\Contracts\Container\BindingResolutionException : Target class [swoole.websocket] does not exist.

Кто-нибудь может мне помочь с этим?

...