File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,8 +126,18 @@ public function shouldRegisterMenuItem(): bool
126126 {
127127 $ hasVerifiedEmail = !is_null (auth ()->user ());//?->hasVerifiedEmail();
128128
129- return Filament::hasTenancy ()
130- ? $ hasVerifiedEmail && Filament::getTenant ()
131- : $ hasVerifiedEmail ;
129+ // Check if Filament is properly initialized before using facades
130+ if (!app ()->bound ('filament ' )) {
131+ return $ hasVerifiedEmail ;
132+ }
133+
134+ try {
135+ return Filament::hasTenancy ()
136+ ? $ hasVerifiedEmail && Filament::getTenant ()
137+ : $ hasVerifiedEmail ;
138+ } catch (\Exception $ e ) {
139+ // Fallback if facade is not ready
140+ return $ hasVerifiedEmail ;
141+ }
132142 }
133143}
Original file line number Diff line number Diff line change @@ -198,8 +198,18 @@ public function shouldRegisterMenuItem(): bool
198198 {
199199 $ hasVerifiedEmail = !is_null (auth ()->user ());//?->hasVerifiedEmail();
200200
201- return Filament::hasTenancy ()
202- ? $ hasVerifiedEmail && Filament::getTenant ()
203- : $ hasVerifiedEmail ;
201+ // Check if Filament is properly initialized before using facades
202+ if (!app ()->bound ('filament ' )) {
203+ return $ hasVerifiedEmail ;
204+ }
205+
206+ try {
207+ return Filament::hasTenancy ()
208+ ? $ hasVerifiedEmail && Filament::getTenant ()
209+ : $ hasVerifiedEmail ;
210+ } catch (\Exception $ e ) {
211+ // Fallback if facade is not ready
212+ return $ hasVerifiedEmail ;
213+ }
204214 }
205215}
You can’t perform that action at this time.
0 commit comments