SettlementBillCreateEvent.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace App\Events;
  3. use App\OwnerLogisticFeeDetail;
  4. use App\OwnerStoreFeeDetail;
  5. use App\OwnerStoreOutFeeDetail;
  6. use App\OwnerWayBillFeeDetail;
  7. use Illuminate\Broadcasting\Channel;
  8. use Illuminate\Broadcasting\InteractsWithSockets;
  9. use Illuminate\Broadcasting\PresenceChannel;
  10. use Illuminate\Broadcasting\PrivateChannel;
  11. use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
  12. use Illuminate\Foundation\Events\Dispatchable;
  13. use Illuminate\Queue\SerializesModels;
  14. class SettlementBillCreateEvent
  15. {
  16. use Dispatchable, InteractsWithSockets, SerializesModels;
  17. const OWNER_LOGISTIC_FEE_DETAIL = OwnerLogisticFeeDetail::class;
  18. const OWNER_STORE_FEE_DETAIL = OwnerStoreFeeDetail::class;
  19. const OWNER_STORE_OUT_FEE_DETAIL = OwnerStoreOutFeeDetail::class;
  20. const OWNER_WAY_BILL_FEE_DETAIL = OwnerWayBillFeeDetail::class;
  21. public $createData;
  22. /**
  23. * OWNER_LOGISTIC_FEE_DETAIL
  24. * OWNER_STORE_FEE_DETAIL
  25. * OWNER_STORE_OUT_FEE_DETAIL
  26. * OWNER_WAY_BILL_FEE_DETAIL
  27. */
  28. public $modelName;
  29. /**
  30. * SettlementBillCreateEvent constructor.
  31. * @param array $createData
  32. * @param string $modelName
  33. */
  34. public function __construct(array $createData, string $modelName)
  35. {
  36. $this->createData = $createData;
  37. $this->modelName = $modelName;
  38. }
  39. /**
  40. * Get the channels the event should broadcast on.
  41. *
  42. * @return \Illuminate\Broadcasting\Channel|array
  43. */
  44. public function broadcastOn()
  45. {
  46. return new PrivateChannel('channel-name');
  47. }
  48. }