1313use App \Traits \Filament \CanCustomizeHeaderWidgets ;
1414use App \Traits \Filament \CanCustomizeTabs ;
1515use BackedEnum ;
16+ use BladeUI \Icons \Exceptions \SvgNotFound ;
17+ use BladeUI \Icons \Factory as IconFactory ;
1618use Exception ;
1719use Filament \Actions \Action ;
1820use Filament \Actions \ActionGroup ;
@@ -68,6 +70,8 @@ class Settings extends Page implements HasSchemas
6870
6971 protected CaptchaService $ captchaService ;
7072
73+ protected IconFactory $ iconFactory ;
74+
7175 /** @var array<mixed>|null */
7276 public ?array $ data = [];
7377
@@ -76,11 +80,12 @@ public function mount(): void
7680 $ this ->form ->fill ();
7781 }
7882
79- public function boot (OAuthService $ oauthService , AvatarService $ avatarService , CaptchaService $ captchaService ): void
83+ public function boot (OAuthService $ oauthService , AvatarService $ avatarService , CaptchaService $ captchaService, IconFactory $ iconFactory ): void
8084 {
8185 $ this ->oauthService = $ oauthService ;
8286 $ this ->avatarService = $ avatarService ;
8387 $ this ->captchaService = $ captchaService ;
88+ $ this ->iconFactory = $ iconFactory ;
8489 }
8590
8691 public static function canAccess (): bool
@@ -565,9 +570,18 @@ private function oauthSettings(): array
565570 foreach ($ oauthSchemas as $ schema ) {
566571 $ key = $ schema ->getConfigKey ();
567572
573+ $ icon = $ schema ->getIcon ();
574+ if (is_string ($ icon )) {
575+ try {
576+ $ this ->iconFactory ->svg ($ icon );
577+ } catch (SvgNotFound ) {
578+ $ icon = null ;
579+ }
580+ }
581+
568582 $ formFields [] = Section::make ($ schema ->getName ())
569583 ->columns (5 )
570- ->icon ($ schema -> getIcon () ?? TablerIcon::BrandOauth)
584+ ->icon ($ icon ?? TablerIcon::BrandOauth)
571585 ->collapsed (fn () => !$ schema ->isEnabled ())
572586 ->collapsible ()
573587 ->schema ([
0 commit comments