Files
InvoiceShelf/config/filesystems.php
Darko Gjorgjijoski 20085cab5d Refactor FileDisk system with per-disk unique names and disk assignments UI
Major changes to the file disk subsystem:

- Each FileDisk now gets a unique Laravel disk name (disk_{id}) instead
  of temp_{driver}, fixing the bug where multiple local disks with
  different roots overwrote each other's config.

- Move disk registration logic from FileDisk model to FileDiskService
  (registerDisk, getDiskName). Model keeps only getDecodedCredentials
  and a deprecated setConfig() wrapper.

- Add Disk Assignments admin UI (File Disk tab) with three purpose
  dropdowns: Media Storage, PDF Storage, Backup Storage. Stored as
  settings (media_disk_id, pdf_disk_id, backup_disk_id).

- Backup tab now uses the assigned backup disk instead of a per-backup
  dropdown. BackupsController refactored to use BackupService which
  centralizes disk resolution. Removed stale 4-second cache.

- Add local_public disk to config/filesystems.php so system disks
  are properly defined.

- Local disk roots stored relative to storage/app/ with hint text
  in the admin modal explaining the convention.

- Fix BaseModal watchEffect -> watch to prevent infinite request
  loops on the File Disk page.

- Fix string/number comparison for disk purpose IDs from settings.

- Add safeguards: prevent deleting disks with files, warn on
  purpose change, prevent deleting system disks.
2026-04-07 02:04:57 +02:00

105 lines
3.1 KiB
PHP

<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application for file storage.
|
*/
'default' => env('FILESYSTEM_DISK', 'local'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Below you may configure as many filesystem disks as necessary, and you
| may even configure multiple disks for the same driver. Examples for
| most supported storage drivers are configured here for reference.
|
| Supported drivers: "local", "ftp", "sftp", "s3"
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => false,
'report' => false,
],
'local_public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_KEY'),
'secret' => env('AWS_SECRET'),
'region' => env('AWS_REGION'),
'bucket' => env('AWS_BUCKET'),
'root' => env('AWS_ROOT'),
],
's3compat' => [
'driver' => 's3',
'endpoint' => env('S3_COMPAT_ENDPOINT'),
'use_path_style_endpoint' => true,
'key' => env('S3_COMPAT_KEY'),
'secret' => env('S3_COMPAT_SECRET'),
'region' => env('S3_COMPAT_REGION'),
'bucket' => env('S3_COMPAT_BUCKET'),
],
'doSpaces' => [
'type' => 'AwsS3',
'driver' => 's3',
'key' => env('DO_SPACES_KEY'),
'secret' => env('DO_SPACES_SECRET'),
'region' => env('DO_SPACES_REGION'),
'bucket' => env('DO_SPACES_BUCKET'),
'root' => env('DO_SPACES_ROOT'),
'endpoint' => env('DO_SPACES_ENDPOINT'),
'use_path_style_endpoint' => false,
],
'dropbox' => [
'driver' => 'dropbox',
'type' => 'DropboxV2',
'token' => env('DROPBOX_TOKEN'),
'key' => env('DROPBOX_KEY'),
'secret' => env('DROPBOX_SECRET'),
'app' => env('DROPBOX_APP'),
'root' => env('DROPBOX_ROOT'),
],
'media' => [
'driver' => 'local',
'root' => public_path('media'),
],
'views' => [
'driver' => 'local',
'root' => resource_path('views'),
],
'pdf_templates' => [
'driver' => 'local',
'root' => storage_path('app/templates/pdf'),
],
],
];