Spatie Media Library breaks with ->disabled()

There appears to be a bug when using Spatie Media Library with the ->disabled() method. Saving the record throws an error, because it is trying to save the media to a column on the model (rather than in the media table)
SpatieMediaLibraryFileUpload::make("my_download")
->disk('media')
->disabled(fn() :bool => false),
SpatieMediaLibraryFileUpload::make("my_download")
->disk('media')
->disabled(fn() :bool => false),
This yields error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'my_download' in 'field list' Once ->disabled() is removed the plugin works as intended. plugin v. 3.2.93
5 Replies
developer
developer2mo ago
i just tried it and it works for me use attachments instead of my_download
bionary
bionary2mo ago
Thanks for testing it out. I still get the error. btw: I think the make('value') is just a unique identifier to help the internals keep track of the form fields. I don't think changing this has any affect. When I originally got this error, I upgraded: composer update filament/spatie-laravel-media-library-plugin but even after this I still get the error
developer
developer2mo ago
ok but the issue is only related to ->disabled() method?
bionary
bionary2mo ago
yes: Spatie Media Library breaks with ->disabled() So yes ->disabled() breaks the media library Still broken
krekas
krekas2mo ago
if it's really broken create a reproduction repo and an issue
Want results from more Discord servers?
Add your server