Skip to content

Commit bb00ac1

Browse files
authored
fix: table empty state (#605)
1 parent e80a118 commit bb00ac1

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

app/Providers/FilamentServiceProvider.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,6 @@ protected function configureTables(): void
142142
});
143143

144144
Table::configureUsing(function (Table $table) {
145-
if (! $table->getModel()) {
146-
return;
147-
}
148-
149145
$format = function (string $class): string {
150146
return Str::of($class)
151147
->classBasename()
@@ -156,17 +152,17 @@ protected function configureTables(): void
156152

157153
$table
158154
->emptyStateIcon(function (Table $table) {
159-
if (! $table->hasAlteredQuery()) {
155+
if (filled($table->getModel()) && ! $table->hasAlteredQuery()) {
160156
return Heroicon::OutlinedClipboardDocument;
161157
}
162158
})
163159
->emptyStateHeading(function (Table $table) use ($format) {
164-
if (! $table->hasAlteredQuery()) {
160+
if (filled($table->getModel()) && ! $table->hasAlteredQuery()) {
165161
return __($format($table->getModel()) . '.empty.title');
166162
}
167163
})
168164
->emptyStateDescription(function (Table $table) use ($format) {
169-
if (! $table->hasAlteredQuery()) {
165+
if (filled($table->getModel()) && ! $table->hasAlteredQuery()) {
170166
return __($format($table->getModel()) . '.empty.description');
171167
}
172168
});

0 commit comments

Comments
 (0)