Skip to content

Fix put() override via custom FilesystemAdapter subclass - #22

Merged
markvaneijk merged 3 commits into
mainfrom
fix/custom-filesystem-adapter
Jun 30, 2026
Merged

Fix put() override via custom FilesystemAdapter subclass#22
markvaneijk merged 3 commits into
mainfrom
fix/custom-filesystem-adapter

Conversation

@markvaneijk

Copy link
Copy Markdown
Member

Summary

  • Fix put() override: FilesystemAdapter::macro('put', ...) was silently ignored because put() is a concrete method on FilesystemAdapter — macros only fire through __call() for methods that don't exist
  • Scope methods to uploadcare disk only: Previously, macros like putGetUuid, fileInfo, etc. were registered globally on all FilesystemAdapter instances, which could cause errors on non-uploadcare disks
  • Introduce UploadcareFilesystemAdapter: A proper subclass that overrides put() and adds putGetUuid(), putFileGetUuid(), putFileAsGetUuid(), and fileInfo() as real instance methods

Test plan

  • Verify Storage::disk('uploadcare')->put(...) routes through UploadcareAdapter::putGetUuid() instead of Laravel's default put()
  • Verify putGetUuid(), putFileGetUuid(), putFileAsGetUuid(), and fileInfo() work on the uploadcare disk
  • Verify non-uploadcare disks (e.g. local, s3) are unaffected and their put() behaves normally

🤖 Generated with Claude Code

markvaneijk and others added 3 commits February 11, 2026 14:08
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>
@markvaneijk
markvaneijk merged commit d1827d5 into main Jun 30, 2026
1 of 45 checks passed
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.

1 participant