FilamentF
Filament12mo ago
Jack

How to format a TextColumn

Hello, i need to remove html tags from a specific column.
    TextColumn::make('body')
                    ->label(__('Body'))
                    ->searchable()
                    ->visibleFrom('md'),


How to remove the html tags from body ->formatStateUsing not working for me.
Solution
or

use Filament\Tables\Columns\TextColumn;
use Illuminate\Support\HtmlString;
 
TextColumn::make('description')
  ->html()
  ->formatStateUsing(fn (string $state) => strip_tags($state))
Was this page helpful?