Skip to content

Commit db54ac6

Browse files
committed
fix empty translation bug
1 parent ce8d894 commit db54ac6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

resources/views/filament/tables/columns/translations.blade.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
@php
22
$flags = $getState(); // Example: More than 4 flags
3+
$visibleFlags = [];
4+
$remainingFlags = 0;
5+
36
try {
4-
$visibleFlags = array_slice($flags, 0, 3); // Show only the first 3
7+
if (is_array($flags)) {
8+
$visibleFlags = array_slice($flags, 0, 3); // Show only the first 3
9+
$remainingFlags = max(0, count($flags) - 3); // Count remaining flags
10+
}
511
} catch (\Exception $e) {
612
$visibleFlags = [];
13+
$remainingFlags = 0;
714
}
8-
$remainingFlags = count($flags) - 4; // Count remaining flags
915
@endphp
1016
<x-filament-forms::field-wrapper>
1117

0 commit comments

Comments
 (0)