Fix put() override via custom FilesystemAdapter subclass - #22
Merged
Conversation
The `put` macro on FilesystemAdapter was silently ignored because `put()` is a concrete method and macros only fire through `__call()`. Additionally, macros were registered globally on all FilesystemAdapter instances. Introduce UploadcareFilesystemAdapter that properly overrides `put()` and adds `putGetUuid`, `putFileGetUuid`, `putFileAsGetUuid`, and `fileInfo` as real methods scoped to the uploadcare disk only. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Widen illuminate/support to ^13.0 - Allow Pest ^4.0 and PHPUnit ^12.0 (required for Laravel 13) - Add Laravel 13 (testbench 11) and PHP 8.4 to the CI matrix - Update README support note Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
put()override:FilesystemAdapter::macro('put', ...)was silently ignored becauseput()is a concrete method onFilesystemAdapter— macros only fire through__call()for methods that don't existputGetUuid,fileInfo, etc. were registered globally on allFilesystemAdapterinstances, which could cause errors on non-uploadcare disksUploadcareFilesystemAdapter: A proper subclass that overridesput()and addsputGetUuid(),putFileGetUuid(),putFileAsGetUuid(), andfileInfo()as real instance methodsTest plan
Storage::disk('uploadcare')->put(...)routes throughUploadcareAdapter::putGetUuid()instead of Laravel's defaultput()putGetUuid(),putFileGetUuid(),putFileAsGetUuid(), andfileInfo()work on the uploadcare disklocal,s3) are unaffected and theirput()behaves normally🤖 Generated with Claude Code