I am trying to do something to run tests on sending laravel events using custom console commands.
Artisan::command('event:send', function () {
event(new \MarketPlex\Events\ClientAction([ 'id' => 4, 'name' => 'MyEvent' ]));
$this->comment(Inspiring::quote());
})->describe('throws an event');
My event,
class ClientAction implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
/**
* The name of the queue on which to place the event.
*
* @var string
*/
public $broadcastQueue = 'client-action';
/**
* Information about the request created by user action (Must be public, otherwise laravel can't serialize).
*
* @var string
*/
public $request;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct(array $request)
{
//
$this->request = $request;
}
}
It does not send anything to pusher server. I checked all keys.
php artisan event:send
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire