mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
eval helper text as parent component
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace Filament\Forms\Components\Concerns;
|
||||
|
||||
use Closure;
|
||||
use Filament\Schemas\Components\Component;
|
||||
use Filament\Schemas\Components\Text;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
|
||||
@@ -10,7 +11,7 @@ trait HasHelperText
|
||||
{
|
||||
public function helperText(string | Htmlable | Closure | null $text): static
|
||||
{
|
||||
$this->belowContent(Text::make($text));
|
||||
$this->belowContent(fn (Component $component): Text => Text::make($component->evaluate($text)));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace Filament\Infolists\Components\Concerns;
|
||||
|
||||
use Closure;
|
||||
use Filament\Schemas\Components\Component;
|
||||
use Filament\Schemas\Components\Text;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
|
||||
@@ -10,7 +11,7 @@ trait HasHelperText
|
||||
{
|
||||
public function helperText(string | Htmlable | Closure | null $text): static
|
||||
{
|
||||
$this->belowContent(Text::make($text));
|
||||
$this->belowContent(fn (Component $component): Text => Text::make($component->evaluate($text)));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user