Php 带计数的Laravel5.2

Php 带计数的Laravel5.2,php,laravel-5,eloquent,laravel-5.2,Php,Laravel 5,Eloquent,Laravel 5.2,我有以下问题,, 我有四种型号: 主要地区|学院|学院|级|学生具有以下资质: class MainArea extends Model { public function institute(){ return $this->belongsTo('\App\Institute'); } public function places(){ return $this->hasMany('\App\Place'); } } class Institute exte

我有以下问题,, 我有四种型号: 主要地区|学院|学院|级|学生具有以下资质:

class MainArea extends Model
{
public function institute(){
 return $this->belongsTo('\App\Institute');     
}
public function places(){

    return $this->hasMany('\App\Place');
}
} 
class Institute extends Model
{
public function insLevel(){
    return $this->hasMany('\App\InstituteLevel');
}
}
class InstituteLevel extends Model
{
public function students(){
    return $this->hasMany('\App\Student','applying_level');
}
}
class Student extends Model
{
public function instituteLevel(){
    return $this->belongsTo('\App\InstituteLevel','institute_level_id');
}
public function place(){
    return $this->belongsTo('\App\Place');
}
}
现在,我想得到所有注册学生的数量,在同一个学院?应该是这样的

        $areas=\App\MainArea::withCount('institute.insLevel.students')->where('institute_id',$id)->get();
有什么建议吗

不幸的是,“withCount()”在Lavel 5.2中不支持嵌套关系