How to use Export Action to export the data of a RichEditor column without the HTML tags.

Actually I have this in place. On my form
Forms\Components\RichEditor::make('comment'),
Forms\Components\RichEditor::make('comment'),
On my exporter
ExportColumn::make('comment')
->state(function (Booking $record): string {
$commentsWithoutTags = strip_tags($record->comment);
return $commentsWithoutTags;
}),
ExportColumn::make('comment')
->state(function (Booking $record): string {
$commentsWithoutTags = strip_tags($record->comment);
return $commentsWithoutTags;
}),
The data is exported without tags but it has spaces where the tags were.
2 Replies
Patrick Boivin
Patrick Boivin7mo ago
Can you share an example of $commentsWithoutTags that has content you would like to clean up?
Pablo Torres
Pablo TorresOP7mo ago
Hi, I was preparing the content of this message, and today it works fine. Below is my DB content and the image showing how the data is exported (without tags or spaces, replacing the tags). Before testing today, I did a composer update, and rich-editor.js has been updated. I'm not sure what really happened.
<p><strong>Magazine</strong> RAC<br><strong>Magazine year</strong> 2024<br><strong>Magazine month</strong> January<br><strong>Magazine issue</strong> 76<br><strong>Size</strong> Full Page Advertisement<br><strong>Price</strong> 2,000.00<br><strong>Category</strong> Fashion &amp; Accessories<br><strong>Invoice number</strong> 1635<br><strong>Billing date</strong> 2024-02-12</p>
<p><strong>Magazine</strong> RAC<br><strong>Magazine year</strong> 2024<br><strong>Magazine month</strong> January<br><strong>Magazine issue</strong> 76<br><strong>Size</strong> Full Page Advertisement<br><strong>Price</strong> 2,000.00<br><strong>Category</strong> Fashion &amp; Accessories<br><strong>Invoice number</strong> 1635<br><strong>Billing date</strong> 2024-02-12</p>
Thank you for time.
No description
Want results from more Discord servers?
Add your server