Category: Laravel

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?
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners