@@ -36,8 +36,13 @@ public static function canAccess(): bool
3636 {
3737 /** @var Server $server */
3838 $ server = Filament::getTenant ();
39+ $ ip = $ server ->allocation ?->ip ?? null ;
3940
40- return parent ::canAccess () && $ server ->allocation && $ server ->allocation ->ip !== '0.0.0.0 ' && $ server ->allocation ->ip !== ':: ' && CloudflareDomain::count () > 0 ;
41+ return parent ::canAccess ()
42+ && $ ip !== null
43+ && $ ip !== '0.0.0.0 '
44+ && $ ip !== ':: '
45+ && CloudflareDomain::count () > 0 ;
4146 }
4247
4348 public static function getNavigationLabel (): string
@@ -80,9 +85,9 @@ public static function table(Table $table): Table
8085 ->state (fn (Subdomain $ subdomain ) => $ subdomain ->getLabel ()),
8186 TextColumn::make ('record_type ' )
8287 ->label (trans ('subdomains::strings.record_type ' ))
83- ->icon (fn (Subdomain $ subdomain ) => $ subdomain ->srv_record && empty ($ subdomain ->server ->node ->srv_target ) ? 'tabler-alert-triangle ' : null ) // @phpstan-ignore variable .undefined
84- ->color (fn (Subdomain $ subdomain ) => $ subdomain ->srv_record && empty ($ subdomain ->server ->node ->srv_target ) ? 'danger ' : null ) // @phpstan-ignore variable .undefined
85- ->tooltip (fn (Subdomain $ subdomain ) => $ subdomain ->srv_record && empty ($ subdomain ->server ->node ->srv_target ) ? trans ('subdomains::strings.srv_target_missing ' ) : null ), // @phpstan-ignore variable .undefined
88+ ->icon (fn (Subdomain $ subdomain ) => $ subdomain ->srv_record && empty ($ subdomain ->server ->node ->srv_target ) ? 'tabler-alert-triangle ' : null ) // @phpstan-ignore property .undefined
89+ ->color (fn (Subdomain $ subdomain ) => $ subdomain ->srv_record && empty ($ subdomain ->server ->node ->srv_target ) ? 'danger ' : null ) // @phpstan-ignore property .undefined
90+ ->tooltip (fn (Subdomain $ subdomain ) => $ subdomain ->srv_record && empty ($ subdomain ->server ->node ->srv_target ) ? trans ('subdomains::strings.srv_target_missing ' ) : null ), // @phpstan-ignore property .undefined
8691 ])
8792 ->recordActions ([
8893 EditAction::make ()
@@ -123,9 +128,9 @@ public static function form(Schema $schema): Schema
123128 ->searchable (),
124129 Toggle::make ('srv_record ' )
125130 ->label (trans ('subdomains::strings.srv_record ' ))
126- ->helperText (fn () => Filament::getTenant ()->node ->srv_target ? trans ('subdomains::strings.srv_record_help ' ) : trans ('subdomains::strings.srv_target_missing ' )) // @phpstan-ignore variable .undefined
131+ ->helperText (fn () => Filament::getTenant ()->node ->srv_target ? trans ('subdomains::strings.srv_record_help ' ) : trans ('subdomains::strings.srv_target_missing ' )) // @phpstan-ignore property .undefined
127132 ->reactive ()
128- ->disabled (fn () => empty (Filament::getTenant ()->node ->srv_target )), // @phpstan-ignore variable .undefined
133+ ->disabled (fn () => empty (Filament::getTenant ()->node ->srv_target )), // @phpstan-ignore property .undefined
129134 ]);
130135 }
131136
0 commit comments