*/ use HasFactory; /** * Get the profile that the department belongs to. * * @return BelongsTo */ public function departmentProfile(): BelongsTo { return $this->belongsTo(DepartmentProfile::class); } /** * Get the services provided by the department. * * @return HasMany */ public function providedServiceEntries(): HasMany { return $this->hasMany(ServiceEntry::class, 'provider_department_id'); } /** * Get the services received by the department. * * @return HasMany */ public function receivedServiceEntries(): HasMany { return $this->hasMany(ServiceEntry::class, 'recipient_department_id'); } /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'is_active' => 'boolean', ]; } }