How to update data without pressing the Submit buttonPrevent
Hello, I will bother again. I want this code to work when you press the submit button. It works as soon as a value is entered in the field. I wonder if there is a solution?
Is it possible to prevent it from updating directly without pressing the Submit button?
15 Replies
Maybe lifecycle hooks can be better:
https://filamentphp.com/docs/2.x/admin/resources/editing-records#lifecycle-hooks
Filament
Editing records - Resources - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
I've seen this but I'm not sure how to adapt it to my code, I can't call it as a method
The logic is the same in a lifecycle hook. The difference is just the data. So in the lifecycle hook you have access to $data, I think that’s the name, that you can use instead of $get
Now, without pressing this submit button, the stock starts to decrease, so I am having problems, I wonder if there is no chance to complete this process when I press the submit button.
what exactly are you trying to do?
Let the user enter the stock status, but when the submit button is pressed, I want this stock status to be updated when the create operation or edit operation takes place.
ok. so you don't need it on the field at all. you just need it in the lifecycle hooks.
Can you give an example, I wonder how I need to use it, how can I transfer this code there?
something like this:
and it'd be the same on your Create except it'd be beforeCreate(), i think.
I will try first thing in the morning and I will be back thank you.
no worries.
Now I had the opportunity to try it, but the form data remaining in the repeater does not come. product_order_id etc. only other fields come
OrdersItem appears when I pull it as a form, but I cannot access it exactly.
I solved 🙂
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View