Добавлена страница штаба
Добавлены графики Добавлены события отчетов
This commit is contained in:
42
app/Events/PatientDataChanged.php
Normal file
42
app/Events/PatientDataChanged.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use App\Models\DepartmentPatient;
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Broadcasting\PrivateChannel;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class PatientDataChanged implements ShouldBroadcast
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
public function __construct(
|
||||
public DepartmentPatient $patient,
|
||||
public string $action
|
||||
) {}
|
||||
|
||||
public function broadcastOn(): array
|
||||
{
|
||||
return [new PrivateChannel('headquarters')];
|
||||
}
|
||||
|
||||
public function broadcastAs(): string
|
||||
{
|
||||
return 'patient.changed';
|
||||
}
|
||||
|
||||
public function broadcastWith(): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->patient->department_patient_id,
|
||||
'department_id' => $this->patient->rf_department_id,
|
||||
'full_name' => $this->patient->full_name,
|
||||
'action' => $this->action,
|
||||
'is_current' => $this->patient->is_current,
|
||||
'changed_at' => now()->toISOString(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user