You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This guide explains how to configure this package to work with S3-compatible storage services like AWS S3 or Cloudflare R2.
4
+
This enables you to transform and serve images stored remotely without the need to store images on your local server.
5
+
6
+
1. Set up your S3 disk in your [filesystems configuration](https://laravel.com/docs/filesystem#amazon-s3-compatible-filesystems), install the [S3 package](https://laravel.com/docs/filesystem#s3-driver-configuration) and ensure you have the necessary credentials and settings for your S3 bucket. Public bucket access is not required.
7
+
8
+
2. Configure the package via `image-transform-url.php` to include your S3 disk in the `source_directories` as described in [the setup guide](/setup#configuring-remote-sources).
9
+
10
+
3. If you are using the [Image Caching](/image-caching) feature and want to store transformed images back to your S3 bucket instead of your local filesystem, you may also set the `cache.disk` option in the `image-transform-url.php` configuration file to your S3 disk.
Having the `cache.disk` set to your S3 disk may result in higher latency and costs due to the nature of remote storage. If you are concerned about performance, consider using a local disk for caching and only use S3 for the source directories.
22
+
:::
23
+
24
+
4. You can now use the [image transformation URLs](/getting-started) as usual, and the package will handle fetching images from your S3 bucket.
If you want to use a remote source (like AWS S3 or Cloudflare R2) as a source directory, you can configure any [Laravel Filesystem disk](https://laravel.com/docs/filesystem#configuration) in your `config/filesystems.php` file and then reference it in the `source_directories` configuration.
49
+
50
+
```php
51
+
'source_directories' => [
52
+
// Other source directories...
53
+
'remote' => [
54
+
'disk' => 's3', // Any valid Laravel Filesystem disk
55
+
'prefix' => 'images', // Optional, if you want to specify a subdirectory
56
+
],
57
+
],
58
+
```
59
+
60
+
Read the [full guide on how to use this package with S3](/s3-usage.md).
0 commit comments