<?php

namespace App\Events;

use App\Http\Controllers\Controller;
use App\LaborReport;
use App\UserDutyCheck;
use Illuminate\Broadcasting\Channel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Queue\SerializesModels;


class ClockoutEvent implements ShouldBroadcast
{
    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);
    }

}
