I would like to select records from a MySQL table with Laravel where NOW() is later than a datetime-field plus the value of an integer-field (seconds). - How can I do this?
Table "records"
- id (int)
- name (varchar)
- updated_at (datetime)
- update_interval (int)
I wish to accomplish something like:
SELECT * FROM records WHERE NOW() > (updated_at + update_interval);
And then written as a Laravel where-condition like:
Record::where( 'NOW()', '>', 'created_at + update_interval' );