advanced-nova-media-library
advanced-nova-media-library copied to clipboard
Support for temporary (signed) url's
I've set my app up with S3 private storage, and media only being accessible via signed temp url. I can implement this myself on the front end but how can I enable this in Nova since none of my images are accessible with their regular urls?
Spatie media library has the getTemporaryUrl method which does this, however it requires me to do some hacking in your handleconversions trait to make use of it and get images working within Nova by changing it to this:
return [
// original needed several purposes like cropping
'__original__' => $media->getTemporaryUrl(Carbon::now()->addMinutes(5), ),
'indexView' => $media->getTemporaryUrl(Carbon::now()->addMinutes(5), $this->meta['conversionOnIndexView'] ?? ''),
'detailView' => $media->getTemporaryUrl(Carbon::now()->addMinutes(5), $this->meta['conversionOnDetailView'] ?? ''),
'form' => $media->getTemporaryUrl(Carbon::now()->addMinutes(5), $this->meta['conversionOnForm'] ?? ''),
'preview' => $media->getTemporaryUrl(Carbon::now()->addMinutes(5), $this->meta['conversionOnPreview'] ?? ''),
];
So if I'm not missing some setting, and it's not currently possible, could I please add this as a feature request to support temp urls
I've opened a PR for this issue if anyone is interested: https://github.com/ebess/advanced-nova-media-library/pull/207