feat: Implement payment method fields, refactor order creation logic to support detailed order items and VM provisioning, and add admin notifications.
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use Illuminate\Broadcasting\Channel;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class OrderProvisioned implements ShouldBroadcast
|
||||
{
|
||||
use Dispatchable, SerializesModels;
|
||||
|
||||
public function __construct(
|
||||
public readonly int $orderId,
|
||||
public readonly string $orderNum,
|
||||
public readonly string $customerName,
|
||||
public readonly string $vmId,
|
||||
public readonly bool $success,
|
||||
public readonly string $message,
|
||||
) {}
|
||||
|
||||
public function broadcastOn(): Channel
|
||||
{
|
||||
return new Channel('admin-notifications');
|
||||
}
|
||||
|
||||
public function broadcastAs(): string
|
||||
{
|
||||
return 'order.provisioned';
|
||||
}
|
||||
|
||||
public function broadcastWith(): array
|
||||
{
|
||||
return [
|
||||
'order_id' => $this->orderId,
|
||||
'order_num' => $this->orderNum,
|
||||
'customer_name' => $this->customerName,
|
||||
'vm_id' => $this->vmId,
|
||||
'success' => $this->success,
|
||||
'message' => $this->message,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user