<?php

namespace App\Events;

use App\LaborReport;
use Illuminate\Broadcasting\Channel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Queue\SerializesModels;


class ImportEvent implements ShouldBroadcast
{
    use  SerializesModels;

    public $laborReport;

    /**
     * Create a new event instance.
     *
     * @return void
     */
    public function __construct(LaborReport $laborReport)
    {
        $this->laborReport=$laborReport;
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return \Illuminate\Broadcasting\Channel|array
     */
    public function broadcastOn()
    {
        $tokenOfBroadcastEnterAndLeave=LaborReport::tokenOfBroadcastEnterAndLeave();
        return new Channel($tokenOfBroadcastEnterAndLeave);
        //return new Channel('laborReport');
    }

}
