Why are you even attempting to store that duration. You can get it any time you need it with a query.
Rule of DB design - don't store derived data.
If you really insist on storing it, why do need two queries?
UPDATE attendance_records
SET duration = timediff(...)
WHERE ...
- a single update would do the job
1. As far as I can tell, the "rules" is supposed to be a string - not an object. If you didn't need to account for is_page_loaded then you should say
<validation-provider ... rules="required|positive_price">
2. The validation function needs to return true or false. You are returning string or false.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.