<?php

namespace App\Events;

use App\LaborReport;
use App\UserDutyCheck;
use Illuminate\Broadcasting\Channel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
use Illuminate\Queue\SerializesModels;


class ClockinEvent implements ShouldBroadcastNow
{
    use  SerializesModels;

    public $laborReport;

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

    /**
     * Get the channels the event should broadcast on.
     *
     * @return \Illuminate\Broadcasting\Channel|array
     */
    public function broadcastOn()
    {
        return new Channel($this->laborReport->userWorkgroup->token);
    }

}
