Repeater::make('Attachments')
->relationship('attachments')
->columns(2)
->hiddenLabel()
->deleteAction(
function ($action) {
$action->requiresConfirmation();
$action->before(function (array $arguments, Repeater $component) {
$itemData = $component->getItemState($arguments['item']);
AttachmentService::deleteAttachment(Attachment::find($itemData['id']));
});
}
)
->schema([...])
Repeater::make('Attachments')
->relationship('attachments')
->columns(2)
->hiddenLabel()
->deleteAction(
function ($action) {
$action->requiresConfirmation();
$action->before(function (array $arguments, Repeater $component) {
$itemData = $component->getItemState($arguments['item']);
AttachmentService::deleteAttachment(Attachment::find($itemData['id']));
});
}
)
->schema([...])