lundi 2 septembre 2019

QUEUE_CONNECTION 'database' works but 'redis' throws 'Array to String conversion'

I am simply trying to run a Event & Listener cycle and pass a model into it

event(new LabelsCreated($model, 'string'));

This works perfectly with QUEUE_CONNECTION=database however with QUEUE_CONNECTION=redis, it throws me an error:

#message: "Array to string conversion"

#code: 0

#file: "/home/vagrant/Code/Upworks/myproj/vendor/laravel/framework/src/Illuminate/Queue/RedisQueue.php"

#line: 302

#severity: E_NOTICE

My Event class looks like this:

class LabelsCreated
{
    use Dispatchable, SerializesModels;

    public $model;

    public $string;

    public function __construct($model, $string)
    {
        $this->model = $model;
        $this->string = $string;

        // comes here
    }
}

but it doesn't queue my Listener at all.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire