Support the ongoing development of →
posted 3 years ago
Last updated 1 year ago.

Maybe start with a Condition interface for your models.

Create models and tables for boolean operations: not, and, or. Not will have one polymorphic condition, the others many.

Have 'value providers'. For example a temperature provider class.

Implement comparators implementing the condition interface. You can have an Integer comparator. When saving it to the database you save the comparison method '<=', the value to compare agains (10), the polymorphic device it refers to (device id 2) and the name of the value provider class.

In a similar fashon you can define actions to be executed when the conditions are met.


Sign in to participate in this thread!


Your banner here too?

guestisp guestisp Joined 17 Apr 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2023 - All rights reserved.