From 08e6179f36a1391c6d48551fc5d19956d7271933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20Ioni=C8=9B=C4=83?= Date: Fri, 22 Dec 2023 20:24:39 +0200 Subject: [PATCH] wip --- .../Organizations/Resources/CommunityResource.php | 14 +++++++++++--- app/Tables/Columns/ServiceChipsColumn.php | 3 +-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/Filament/Organizations/Resources/CommunityResource.php b/app/Filament/Organizations/Resources/CommunityResource.php index 126b80f4..767edc0c 100644 --- a/app/Filament/Organizations/Resources/CommunityResource.php +++ b/app/Filament/Organizations/Resources/CommunityResource.php @@ -84,19 +84,27 @@ public static function infolist(Infolist $infolist): Infolist TextEntry::make('website') ->icon('heroicon-o-link') ->hiddenLabel() - ->url(fn (string $state) => $state) + ->url(fn (?string $state) => $state) ->openUrlInNewTab(), TextEntry::make('email') ->icon('heroicon-o-envelope') ->hiddenLabel() - ->url(fn (string $state) => "mailto:{$state}") + ->url( + fn (?string $state) => $state !== null + ? "mailto:{$state}" + : null + ) ->openUrlInNewTab(), TextEntry::make('phone') ->icon('heroicon-o-phone') ->hiddenLabel() - ->url(fn (string $state) => "tel:{$state}") + ->url( + fn (?string $state) => $state !== null + ? "tel:{$state}" + : null + ) ->openUrlInNewTab(), ]), ]), diff --git a/app/Tables/Columns/ServiceChipsColumn.php b/app/Tables/Columns/ServiceChipsColumn.php index 8c0800ab..4a57e9fe 100644 --- a/app/Tables/Columns/ServiceChipsColumn.php +++ b/app/Tables/Columns/ServiceChipsColumn.php @@ -34,7 +34,6 @@ public function getSize(mixed $state): string | null public function getServices(): Collection { return collect($this->getState()) - ->filter(fn ($service) => $service->is_visible) - ->dump(); + ->filter(fn ($service) => $service->is_visible); } }