Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

glasstream2000's avatar

Toggle a checkbox and average the values of each checkbox that has been toggled

I have checkboxes that when toggle they pull data from the database and show the numbers. What i want to do now is take the numbers that are shown (depending on what checkboxes the user selected) and average the numbers that are shown (pulled from the DB with Laravel) What would be the best way to go about this, Laravel does't do this to my knowledge. it will average a group of numbers but not what a user selects to show on the screen (that I know of) Would this be more of a Javascript application or is there something better that I can learn to achieve this?

0 likes
2 replies
Sinnbeck's avatar

Sounds like something you could easily do with livewire if you don't want to use pure Javascript

glasstream2000's avatar

Is it at all possible to do just in Laravel? like select the boxes you want to compare and then click a button and go to another page that has just those that were select with their values?

Please or to participate in this conversation.