- protected FilesystemManager $fileSystem;
-
- /**
- * AttachmentService constructor.
- */
- public function __construct(FilesystemManager $fileSystem)
- {
- $this->fileSystem = $fileSystem;
- }
-
- /**
- * Get the storage that will be used for storing files.
- */
- protected function getStorageDisk(): Storage
- {
- return $this->fileSystem->disk($this->getStorageDiskName());
- }
-
- /**
- * Get the name of the storage disk to use.
- */
- protected function getStorageDiskName(): string
- {
- $storageType = config('filesystems.attachments');
-
- // Change to our secure-attachment disk if any of the local options
- // are used to prevent escaping that location.
- if ($storageType === 'local' || $storageType === 'local_secure' || $storageType === 'local_secure_restricted') {
- $storageType = 'local_secure_attachments';
- }
-
- return $storageType;
+ public function __construct(
+ protected FileStorage $storage,
+ ) {