level === 1) { return $this->belongsTo(Department::class, 'division_id'); } else if ($this->level === 2) { return $this->belongsTo(Faculty::class, 'division_id'); } return null; } }