After scanning through nearly every Google and SO hit, I still can't fix this.
In my app, a user can upload a picture. Because the user's data is pretty sensitive, I save everything in the storage folder and use php to serve the image.
View
<img src="{{ asset('logo/' . $organization->logo_thumbnail_path) }}" alt="">
Route
Route::get('logo/{logo}', function($logo) {
$image = Image::make(Storage::disk('logo-image')->get($logo));
$image->response();
});
The route looks in storage/app/img/logo
for the corresponding filename. If I echo Storage::disk('logo-image')->get($logo)
, I get an immense page of weird characters which leads me to believe it does get the actual .jpg image.
However the image isn't displayed, even if I visit the route directly.
Also, if I change the route to take me back to the homepage and I open the view in which the image should be rendered, nothing happens. Which leads me to believe the route is never called from within the <img>
tag.
Do any of you know more of this? I'm quite stuck and hours of searching hasn't done anything.
EDIT: Manually setting all the headers and stuff in the response, makes sure the image gets displayed.