Unable to add Actions Inside Placeholder content of edit modal form.

How can I add an action inside Placehoder inside form widget.
Here is how I have used Placeholder:
Placeholder::make('notes')
->label('')
->content(
function ($record) {
if ($record?->notes) {
foreach ($record?->notes as $note) {
echo "<div class='bg-gray-100 p-2 mb-2 rounded-lg'>";
// echo "<div class='text-sm text-gray-500'>{$note->user->name} - {$note->created_at->diffForHumans()}</div>";
echo "<div class='text-sm'>{$note->content}</div>";
echo "</div>";
}
}
}
),

I am displaying the notes of a user and I want to add a delete/remove action next to each note
Solution
Why don't you use a Repeater instead?
If you really want custom formatting, you are better off with a custom view file or view field
Was this page helpful?