When developing a project for a client, a doubt arose: how create a dynamic query using only Eloquent? Maybe, you can think: “It’s easy! We can use the method when”.
E.g.: I, Rafael, intent elevate my English and Spanish level, therefore, intent study English by one hour, in every Sunday, Wednesday and Friday, during a one month; and, Spanish, every Tuesday, Thursday and Saturday. Now, imagine that you receive the dates using a numeric representation, in that 0 is equals a Monday, and 6 is a Saturday, thus we can represent the received data by the vector below: As every people that want to study, not like be interrupted to make another thing, therefore, we need grant this event not collide with another. So, more one time, how make this, using only Eloquent?