I have eloquent models such as
User : users (identifier, username, password, email address, status)
Profile : profiles (id, user_id, first_name, last_name, gender, dob)
In the controller logic, I look forward to loading the profile model.
I can do it,
$user = User::with('Profile')->get();
or
$user = User::with('Profile')->where('status', '1')->get();
but how to do something like
$user = User::with('Profile')->where('status', '1')->where('gender', 'Male')->get();
source share