<?php

namespace App\Events;

use App\OrderPackage;
use Illuminate\Broadcasting\Channel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
use Illuminate\Queue\SerializesModels;

class WeighedEvent implements ShouldBroadcastNow
{
    use  SerializesModels;

    public $package;

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

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

}
