SettlementBillCreateEvent.php 1.6 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. //快递费
  18. const OWNER_LOGISTIC_FEE_DETAIL = OwnerLogisticFeeDetail::class;
  19. //入库费
  20. const OWNER_STORE_FEE_DETAIL = OwnerStoreFeeDetail::class;
  21. //出库
  22. const OWNER_STORE_OUT_FEE_DETAIL = OwnerStoreOutFeeDetail::class;
  23. //物流费
  24. const OWNER_WAY_BILL_FEE_DETAIL = OwnerWayBillFeeDetail::class;
  25. public $createData;
  26. /**
  27. * OWNER_LOGISTIC_FEE_DETAIL
  28. * OWNER_STORE_FEE_DETAIL
  29. * OWNER_STORE_OUT_FEE_DETAIL
  30. * OWNER_WAY_BILL_FEE_DETAIL
  31. */
  32. public $modelName;
  33. /**
  34. * SettlementBillCreateEvent constructor.
  35. * @param array $createData
  36. * @param string $modelName
  37. */
  38. public function __construct(array $createData, string $modelName)
  39. {
  40. $this->createData = $createData;
  41. $this->modelName = $modelName;
  42. }
  43. /**
  44. * Get the channels the event should broadcast on.
  45. *
  46. * @return \Illuminate\Broadcasting\Channel|array
  47. */
  48. public function broadcastOn()
  49. {
  50. return new PrivateChannel('channel-name');
  51. }
  52. }