belongsTo(Service::class); } public function persistentStorages() { return $this->morphMany(LocalPersistentVolume::class, 'resource'); } public function fileStorages() { return $this->morphMany(LocalFileVolume::class, 'resource'); } public function fqdns(): Attribute { return Attribute::make( get: fn () => is_null($this->fqdn) ? [] : explode(',', $this->fqdn), ); } public function saveFileVolumes() { saveFileVolumesHelper($this); } public function configurationRequired() { $required = false; foreach($this->fileStorages as $fileStorage) { if (!$fileStorage->is_directory && $fileStorage->content == null) { $required = true; break; } } return $required; } }