From 735be715bb02f9299beb4da0e74fd4176bd52b9e Mon Sep 17 00:00:00 2001 From: StephaneBour Date: Fri, 23 Feb 2024 16:44:47 +0100 Subject: [PATCH] chore(docs): add how use custom disk --- docs/core/reference/images.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/core/reference/images.md b/docs/core/reference/images.md index 78347262a7..27cf44fb0b 100644 --- a/docs/core/reference/images.md +++ b/docs/core/reference/images.md @@ -121,3 +121,18 @@ class YourCustomModel extends Model ``` Now your models will auto generate transforms as defined in your configuration and still use medialibrary under the hood. + +## Use custom disk + +By default, media is stored on the `public` disk. If you want to use a different disk, you need to set the environment variable `MEDIA_DISK` to the name of the disk you want to use. + +```shell +MEDIA_DISK=s3 +``` +If you need more customisation, you can install publish the configuration file of `spatie/laravel-medialibrary`. + +```shell +php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="config" +``` + +Then you can change the disk in the configuration file `config/media-library.php`.