Skip to content

Commit

Permalink
Docs - add how use custom disk (#1582)
Browse files Browse the repository at this point in the history
Hello,

I use a particular filesystem for images
(https://github.com/sausin/laravel-ovh), and I needed to change the
default disk.

I spent some time figuring out how to do this, so I completed the
documentation for that.

Thank you.
  • Loading branch information
StephaneBour authored May 6, 2024
1 parent 28f2a82 commit 684aa6f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/core/reference/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

0 comments on commit 684aa6f

Please sign in to comment.