*/ public $tickets; public static function canAccess(): bool { $user = Auth::user(); return $user instanceof User && $user->hasAnyRole(['super-admin', 'admin', 'amministratore', 'collaboratore']); } public function mount(): void { $user = Auth::user(); if (! $user instanceof User) { $this->tickets = collect(); return; } $stabileId = StabileContext::resolveActiveStabileId($user); if (! $stabileId) { $this->tickets = collect(); return; } $this->tickets = Ticket::query() ->where('stabile_id', $stabileId) ->whereIn('stato', ['Aperto', 'Preso in Carico', 'In Lavorazione']) ->where('priorita', '!=', 'Urgente') ->latest('data_apertura') ->limit(20) ->get(); } }