I have a Laravel form that has a user input their daily times for driving and working times. Based on entering those 2 fields and pressing submit, a calculation occurs where 480 subtracts the driving time plus the working time and that outputs admin time. Is there any way to make that calculation happen in the form as it is being filled in?
Controller currently:
$energy->admin_time = 480 - ($request->input('driving_time') + $request->input('work_time'));
$energy->driving_time = $request->input('driving_time');
$energy->work_time = $request->input('work_time');