belongsTo(Unit::class); } public function contracts() { return $this->belongsToMany(Contract::class, 'contract_subunits'); } protected static function boot() { parent::boot(); static::creating(fn($model) => $model->created_by = auth()->id()); static::updating(fn($model) => $model->updated_by = auth()->id()); } }