belongsTo(User::class, 'manager_id'); } public function parent(): BelongsTo { return $this->belongsTo(self::class, 'parent_id') ->whereKeyNot($this->getKey()); } public function children(): HasMany { return $this->hasMany(self::class, 'parent_id'); } public function employeeships(): HasMany { return $this->hasMany(FilamentCompanies::employeeshipModel(), 'department_id'); } protected static function newFactory(): Factory { return DepartmentFactory::new(); } }