Maybe something like this,
// might need some tweaking since I do not have a table to test against.
$projectID = $this->getID();
$result = DB::table('users')
->select(DB::raw('count(*) as members'))
->whereIn('rank', function($query) use ($projectID) {
$query->select('id')->from('user_ranks')->where('project_id', $projectID);
})->get() ;
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community