i dont think with() does a join. it makes two queries ? try this
$users = User::join('user_details', 'user.user_id', '=', 'user_details.user_id')->select('users.user_id', 'users_details.phone')->get();
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community