I'm currently developing a project in laravel based on studies, but I'm having some difficulties with displaying a profile picture. The upload is done correctly, the image is uploaded to the server and also to the database, however, it is still not displayed in my application, always returning an image link not found.
if(!empty(\Illuminate\Support\Facades\Auth::user()->cover) &&
\Illuminate\Support\Facades\File::exists(public_path() . '/storage/' . \Illuminate\Support\Facades\Auth::user()->cover)){
$cover = \Illuminate\Support\Facades\Auth::user()->url_cover;
} else {
$cover = \Illuminate\Support\Facades\Auth::user()->url_cover;
}
<aside class="dash_sidebar">
<article class="dash_sidebar_user">
<img class="dash_sidebar_user_thumb" src="{{ $cover }}" alt="" title=""/>
<h1 class="dash_sidebar_user_name">
<a href="{{ route('admin.users.edit', ['user' => \Illuminate\Support\Facades\Auth::user()->id]) }}">{{ \Illuminate\Support\Facades\Auth::user()->name }}</a>
</h1>
I already tried the command php artisan storage:link but without success. My .env configuration is correct too.