Level 104
mysql (if you're using it) has a DAYNAME(date) function so you can constrain your query like this:
Member::whereRaw("DAYNAME(birthday) = 'Friday'")->get()
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
i have a database of members with their birthdays stored as date in this format: Y-m-d. e.g 2002-01-15. i want to query the database and group the members by the days of the week from their birthdays like so: members/day-borns/friday should return all those born on friday and memers/day-borns should return all grouped by the days of the week.
any help? how do i go about it?
Please or to participate in this conversation.