Skip to content

Commit

Permalink
Merge pull request #11410 from comes/3.x
Browse files Browse the repository at this point in the history
Use new `hasActualContent` method on slots
  • Loading branch information
danharrin committed Feb 23, 2024
2 parents f03d17b + aa7f654 commit 32e072c
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions packages/support/src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Illuminate\Support\Str;
use Illuminate\Translation\MessageSelector;
use Illuminate\View\ComponentAttributeBag;
use Illuminate\View\ComponentSlot;

if (! function_exists('Filament\Support\format_money')) {
/**
Expand Down Expand Up @@ -120,18 +121,11 @@ function is_slot_empty(?Htmlable $slot): bool
return true;
}

return trim(
str_replace(
[
'<!-- __BLOCK__ -->',
'<!-- __ENDBLOCK__ -->',
'<!--[if BLOCK]><![endif]-->',
'<!--[if ENDBLOCK]><![endif]-->',
],
'',
$slot->toHtml()
),
) === '';
if (! $slot instanceof ComponentSlot) {
$slot = new ComponentSlot($slot->toHtml());
}

return $slot->hasActualContent();
}
}

Expand Down

0 comments on commit 32e072c

Please sign in to comment.