From 903ab95d6cf455f4faa54419c9e8aa883395c742 Mon Sep 17 00:00:00 2001 From: Nisse Lommerde Date: Wed, 23 Apr 2025 15:13:44 -0700 Subject: [PATCH] Limit max customer name length and add tooltip --- app/Filament/Admin/Resources/OrderResource.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/Filament/Admin/Resources/OrderResource.php b/app/Filament/Admin/Resources/OrderResource.php index 7864236..04cf610 100644 --- a/app/Filament/Admin/Resources/OrderResource.php +++ b/app/Filament/Admin/Resources/OrderResource.php @@ -347,6 +347,17 @@ public static function table(Table $table): Table ->sortable(), TextColumn::make('customer.company_name') + ->limit(25) + ->tooltip(function (TextColumn $column): ?string { + $state = $column->getState(); + + if (strlen($state) <= $column->getCharacterLimit()) { + return null; + } + + // Only render the tooltip if the column content exceeds the length limit. + return $state; + }) ->searchable() ->sortable(),