Skip to content

feat(gcs): Allow custom public URL for GoogleCloudStorageAdapter#1891

Open
QDenka wants to merge 1 commit intothephpleague:3.xfrom
QDenka:feature/custom-public-url-gcs
Open

feat(gcs): Allow custom public URL for GoogleCloudStorageAdapter#1891
QDenka wants to merge 1 commit intothephpleague:3.xfrom
QDenka:feature/custom-public-url-gcs

Conversation

@QDenka
Copy link
Copy Markdown

@QDenka QDenka commented Feb 8, 2026

Summary

Adds an optional publicUrl constructor parameter to GoogleCloudStorageAdapter to override the default https://storage.googleapis.com base URL used when generating public URLs.

Motivation

Google Cloud Storage supports custom domains for buckets. Currently the public URL is hardcoded, making it impossible to use a custom domain.

Closes #1878

Changes

  • Added optional publicUrl parameter to the constructor
  • When a custom URL is provided, the bucket name is omitted from the generated URL (the custom domain already maps to the correct bucket)
  • Added tests for default and custom URL generation
  • Backward compatible — default behavior is unchanged

Adds an optional `publicUrl` constructor parameter to override the
default `https://storage.googleapis.com` base URL used when generating
public URLs. When a custom URL is provided, the bucket name is omitted
from the generated URL (assuming the custom domain already maps to the
correct bucket).

Closes thephpleague#1878
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow to use different URL for GoogleCloudStorageAdapter

1 participant