Prevent multiple calls to the same model
I have the following scenario
Basically, I'm setting a
Any recommendations to avoid doing this?
Basically, I'm setting a
maxValue on the quantity field. I'm also adding a helperText to give the user a more helpfull message. But I'm calling the same thing twice.Any recommendations to avoid doing this?
Solution
I guess that's up to you to decide. I just said that because sometimes an extra
In any case, if you're in laravel 11+, have a look at this too https://flanger.dev/blog/post/avoid-duplicate-queries-in-filament-closures-for-eloquent-records
find query is no big deal.In any case, if you're in laravel 11+, have a look at this too https://flanger.dev/blog/post/avoid-duplicate-queries-in-filament-closures-for-eloquent-records