refactore(core): use property promotion
This commit is contained in:
parent
84c773f7a2
commit
b55bd0c4ce
1 changed files with 6 additions and 7 deletions
|
|
@ -7,19 +7,18 @@
|
||||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||||
use Illuminate\Foundation\Events\Dispatchable;
|
use Illuminate\Foundation\Events\Dispatchable;
|
||||||
use Illuminate\Queue\SerializesModels;
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
|
||||||
class ServiceStatusChanged implements ShouldBroadcast
|
class ServiceStatusChanged implements ShouldBroadcast
|
||||||
{
|
{
|
||||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||||
|
|
||||||
public ?int $teamId = null;
|
public function __construct(
|
||||||
|
public ?int $teamId = null
|
||||||
public function __construct($teamId = null)
|
) {
|
||||||
{
|
if (is_null($this->teamId) && Auth::check() && Auth::user()->currentTeam()) {
|
||||||
if (is_null($teamId) && auth()->check() && auth()->user()->currentTeam()) {
|
$this->teamId = Auth::user()->currentTeam()->id;
|
||||||
$teamId = auth()->user()->currentTeam()->id;
|
|
||||||
}
|
}
|
||||||
$this->teamId = $teamId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function broadcastOn(): array
|
public function broadcastOn(): array
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue