5cd8c05a7c
- Create InspectionPassed event - Create MoveCardToPackingOnInspectionPassed listener - Register event listener in EventServiceProvider - Dispatch event when markInspectionPassed() is called Now when an order passes inspection on the ops page, the Trello card automatically moves from Inspection to Packing list.
27 lines
544 B
PHP
27 lines
544 B
PHP
<?php
|
|
|
|
namespace App\Events;
|
|
|
|
use App\Models\Order;
|
|
use Illuminate\Broadcasting\Channel;
|
|
use Illuminate\Broadcasting\InteractsWithBroadcasting;
|
|
use Illuminate\Broadcasting\PrivateChannel;
|
|
use Illuminate\Foundation\Events\Dispatchable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class InspectionPassed
|
|
{
|
|
use Dispatchable, SerializesModels;
|
|
|
|
public function __construct(
|
|
public Order $order,
|
|
) {}
|
|
|
|
public function broadcastOn(): array
|
|
{
|
|
return [
|
|
new PrivateChannel('channel-name'),
|
|
];
|
|
}
|
|
}
|