Добавлена страница штаба

Добавлены графики
Добавлены события отчетов
This commit is contained in:
brusnitsyn
2026-05-31 21:57:21 +09:00
parent 51b0dcc864
commit 0a882b0cb2
21 changed files with 2779 additions and 386 deletions

View 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(),
];
}
}