Query Builder for Laravel to count all 25 to 35 years old that are single

Viewed 1460

Here are the columns of my member_profiles table:

id
last_name
first_name
birthday
civil_status

Civil status values are "single", "married", and "divorced".

This table already have thousands of entries. I want to count all members that are 25 to 27 years old that are single.

I could start off with something like this, but don't know how to continue to match it up with specific age range

$members = MemberProfile::where('civil_status', 'single')->count();

2 Answers
Related