<?php

namespace App\Events;

use Illuminate\Queue\SerializesModels;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;

class AutoSerahan implements ShouldBroadcast
{
  use Dispatchable, InteractsWithSockets, SerializesModels;

  public $pengesahan;
  public $cawangan;
  public $kodlaluan;
  public $id;

  public function __construct($pengesahan,$id,$cawangan,$kodlaluan)
  {
      $this->pengesahan = $pengesahan;
      $this->id = $id;
      $this->cawangan = $cawangan;
      $this->kodlaluan = $kodlaluan;
  }

  public function broadcastOn()
  {
    return ['autoserahan-notice'];
  }

  public function broadcastAs()
  {
    return 'autoserahan-event';
  }
}