<?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/private'),
            'serve' => true,
            'throw' => false,
            'report' => false,
        ],

        // User uploads live DIRECTLY in the web root at public/user-uploads —
        // no storage:link symlink needed (shared-hosting-robust; some hosts
        // disable symlink()). Served as {APP_URL}/user-uploads/{path}.
        'public' => [
            'driver' => 'local',
            'root' => public_path('user-uploads'),
            'url' => rtrim(env('APP_URL', 'http://localhost'), '/').'/user-uploads',
            'visibility' => 'public',
            'throw' => false,
            'report' => false,
        ],

        // Pinned local-FS view of `public/user-uploads`. The `public` disk
        // gets overlaid to S3/Minio when admin flips the active storage
        // disk, so it can no longer be used to read pre-migration files.
        // `local_public` stays anchored regardless so the migrate sweep
        // can still copy local→cloud after the overlay is applied.
        'local_public' => [
            'driver' => 'local',
            'root' => public_path('user-uploads'),
            'url' => rtrim(env('APP_URL', 'http://localhost'), '/').'/user-uploads',
            'visibility' => 'public',
            'throw' => false,
            'report' => false,
        ],

        's3' => [
            'driver' => 's3',
            'key' => env('AWS_ACCESS_KEY_ID'),
            'secret' => env('AWS_SECRET_ACCESS_KEY'),
            'region' => env('AWS_DEFAULT_REGION'),
            'bucket' => env('AWS_BUCKET'),
            'url' => env('AWS_URL'),
            'endpoint' => env('AWS_ENDPOINT'),
            'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
            'throw' => false,
            'report' => false,
        ],

    ],

    /*
    |--------------------------------------------------------------------------
    | Symbolic Links
    |--------------------------------------------------------------------------
    |
    | Here you may configure the symbolic links that will be created when the
    | `storage:link` Artisan command is executed. The array keys should be
    | the locations of the links and the values should be their targets.
    |
    */

    // No symlinks: AppShot serves local uploads directly from public/user-uploads
    // (the `public` disk root), so the legacy public/storage → storage/app/public
    // link is unnecessary. `php artisan storage:link` is a no-op.
    'links' => [],

];
