'Best way to use SEO friendly urls to images with hashed filenames in Laravel
We use Laravel 8 and our images are stored with the help of the UploadedFile->store(...); method. Therefore the stored filenames are hashed (like we want to) e.g. BgsfuLGXEO9K9cQdYDfKHmDfjQmGDJb0o3CPMK6E.jpg. We want use SEO proof image filenames in the HTML output. Therefore we want to prefix or postfix the filename something like orange-tulip-BgsfuLGXEO9K9cQdYDfKHmDfjQmGDJb0o3CPMK6E.jpg. But Storage::url('sitepictures/' . $this->filename) of course returns https://example.com/sitepictures/BgsfuLGXEO9K9cQdYDfKHmDfjQmGDJb0o3CPMK6E.jpg
The solutions we've found so far are kind of hacky. What is/are the best way(s) to use SEO proof image filenames using Laravels Storage?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
