How do I do this Stock Control ?

I think I've asked too many questions today. I apologise. But I want to take the product_price_id available in my code above and compare it with the stock status entered from the outside and give an error if the value entered is more.
6 Replies
Dan Harrin
Dan Harrin2y ago
FYI you dont need required numeric min:0 in that validation array we do that all for you
->rule(function ($get) {
return function ($attribute, value, $fail) use ($get) {
// $get('product_order_id')
};
})
->rule(function ($get) {
return function ($attribute, value, $fail) use ($get) {
// $get('product_order_id')
};
})
search "closure customization" in the docs
Mehmet K.
Mehmet K.OP2y ago
Thank you. But there was a problem like this It takes the id of the first data in the repater, it does not take the selected one, so the system makes a wrong calculation.
Dan Harrin
Dan Harrin2y ago
hmm it should definitely get the current repeater item value
Mehmet K.
Mehmet K.OP2y ago
Do you have any information on how exactly I can do this?
Dan Harrin
Dan Harrin2y ago
the way youre doing it should work so im confused
Mehmet K.
Mehmet K.OP2y ago
I think I made a mistake, I think the problem occurred because I searched with find. No problem in the code thank you
Want results from more Discord servers?
Add your server