© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
4 replies
Abel Cobreros

Issue with halt() on beforeSave and a repeater with relationship

So I am working on a Inventory Management System for a client where we have to deal with inventory (product with boxes, batches, etc) and I am having an issue when managing the products added to a sale.

So if I am editing a sale with 3 products and I delete one of them, when I click save I want to reset the stock assigned for those 3 products and after the sale is updated I want to assign the stock again to the 2 products that are left. However, looks like the repeater is doing it's own thing independently and on beforeSave I can only see the 2 products that are left and not the 3 that were originally there.

I have been playing around and I've figured that if I try to get the list of products with $this->record->saleProducts on beforeSave(), the actual sale_products table gets updated so is impossible for me to see if a product has been deleted or not.

I have tried to alter the delete action of the repeater and I can reassing the stock and everything but if the user does not click save later the deleted product shows again and now the inventory does not match the reality.

What am I doing wrong?
Solution
Completely forgot about this post I made. The solution was to called the booted static method in the model that is used inside the repeater and call the static::deleting method to reset the stock in there:
image.png
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

issue with repeater and relationship
FilamentFFilament / ❓┊help
7mo ago
Relationship Repeater in EditRecord saves before beforeSave?
FilamentFFilament / ❓┊help
3y ago
Halt on beforeSave is preventing actions within notification to work.
FilamentFFilament / ❓┊help
15mo ago
Repeater with relationship and group by
FilamentFFilament / ❓┊help
3y ago