From b55bd0c4ceb633e2a7e04b68afce423262293866 Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Tue, 20 May 2025 13:23:09 +0200 Subject: [PATCH] refactore(core): use property promotion --- app/Events/ServiceStatusChanged.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/app/Events/ServiceStatusChanged.php b/app/Events/ServiceStatusChanged.php index 506f77881..97ca4b0f8 100644 --- a/app/Events/ServiceStatusChanged.php +++ b/app/Events/ServiceStatusChanged.php @@ -7,19 +7,18 @@ use Illuminate\Broadcasting\PrivateChannel; use Illuminate\Contracts\Broadcasting\ShouldBroadcast; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; +use Illuminate\Support\Facades\Auth; class ServiceStatusChanged implements ShouldBroadcast { use Dispatchable, InteractsWithSockets, SerializesModels; - public ?int $teamId = null; - - public function __construct($teamId = null) - { - if (is_null($teamId) && auth()->check() && auth()->user()->currentTeam()) { - $teamId = auth()->user()->currentTeam()->id; + public function __construct( + public ?int $teamId = null + ) { + if (is_null($this->teamId) && Auth::check() && Auth::user()->currentTeam()) { + $this->teamId = Auth::user()->currentTeam()->id; } - $this->teamId = $teamId; } public function broadcastOn(): array