Fix: photos uploaded in the admin were stored privately and did not show on the website
The admin upload field used Filament's default disk (FILESYSTEM_DISK=local, private), while imports and the website use the public disk – a photo uploaded in the admin appeared in the photo list but its web sizes returned 403 (e.g. as floor plan picture). The photo collection and the upload field now always use the public disk; a data migration moves photos already stored privately (original and web sizes, folder = media id) to the public disk. Tests for the upload and the migration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
dfd3f77a5d
commit
1871c04507
4 files changed
+88
No files matched your search
@@ -45,7 +45,9 @@ protected function casts(): array
|
||||
|
||||
public function registerMediaCollections(): void
|
||||
{
|
||||
// Website photos are public files; the app's default disk (FILESYSTEM_DISK=local) is private.
|
||||
$this->addMediaCollection(self::COLLECTION)
|
||||
->useDisk('public')
|
||||
->singleFile()
|
||||
->acceptsMimeTypes(['image/jpeg', 'image/png', 'image/webp']);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user