@Nakov
My models :
Builders:
public function project(){
return $this->hasMany(Projects::class, 'project_builder', 'id');
}
Projects:
public function builder(){
return $this->belongsTo(Builders::class,'project_builder','id');
}
public function city(){
return $this->belongsTo(Cities::class,'project_city','id');
}
Cities:
public function project(){
return $this->hasMany(Projects::class, 'project_city', 'id');
}
My query is giving me the list of builders with total of all the PROJECTS ( in all the CITIES ) , what I need is the list of BUILDERS with total of PROJECTS in CITIES with status = 1.