Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

refactore(core): use property promotion

peaklabs-devb55bd0c4ceb6
diff --git a/app/Events/ServiceStatusChanged.php b/app/Events/ServiceStatusChanged.php
index 506f77881a..97ca4b0f8c 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