Did you php artisan storage:link?
Then:
<img
class="image rounded-circle"
src="{{ asset('storage/images/user.png') }}"
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi!
Cant get this to work, dosent find the image ??
<div class="card-body">
<div class="row">
<div class="col-md-12">
<img
class="image rounded-circle"
:src="'../storage/images/user.png'"
alt="profile_image"
style="
width: 200px;
height: 200px;
padding: 10px;
margin: 0px;
"
/>
</div>
</div>
</div>
Line -> :src="'../storage/images/user.png'"
Gives me 404 error
Did you php artisan storage:link?
Then:
<img
class="image rounded-circle"
src="{{ asset('storage/images/user.png') }}"
@tykus Hi!
Yes have run -> php artisan storage:link
Tryed your code, get error:
src="{{ asset('storage/images/user.png') }}": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div id="{{ val }}">, use <div :id="val">.
@birdietorerik so, this is a Vue component; you might have mentioned that earlier or posted in the correct forum?
Are you passing data as a prop; or are you actually hard-coding the image path?
@tykus Hi! Harcoded this, before i use image from DB -> vue prop
@birdietorerik in that case, use the absolute path
<img
class="image rounded-circle"
src="/storage/images/user.png"
@birdietorerik where is the image actually stored? And what links are created by the storage:link command - check your config/filesystems.php config file for the links key?
@birdietorerik start by getting the storage working first. Just open the image directly in a browser http://portal.test:8000/storage/images/user.png
@tykus Hi!
Filesystem.php
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away!
|
*/
'default' => env('FILESYSTEM_DRIVER', 'local'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
|
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
],
],
/*
|--------------------------------------------------------------------------
| Symbolic Links
|--------------------------------------------------------------------------
|
| Here you may configure the symbolic links that will be created when the
| `storage:link` Artisan command is executed. The array keys should be
| the locations of the links and the values should be their targets.
|
*/
'links' => [
public_path('storage') => storage_path('app/public'),
],
];
@birdietorerik do you actually have a user.png image in the {PROJECT_ROOT}/storage/app/public/images directory?
@tykus Hi! Yes
@birdietorerik and visiting the URL directly in the Browser also results in a 404?
@birdietorerik and also [root]/public/storage/images?
@tykus Hi! Yes
@birdietorerik have you actually linked the directory?
@Sinnbeck Hi! Yes
@birdietorerik did you check if you could find the file inside the public directory? /public/storage/images
@birdietorerik Try to create a storage link manually:
Run this command from public folder
ln -s ../storage/app/public storage
@Sinnbeck images was missing ? I created this folder And copy my user.png file from storage/images Now i get 200 status, but image not showing ????
@birdietorerik you shouldn’t create the folder, it should be a symlink to the directory in storage
@birdietorerik so the storage link command failed i assume.
@Sinnbeck No
Hi!
I get this in my console -> network
http://portal.test:8000/admin/storage/images/user.png
Request Method: GET
Status Code: 200 OK
Remote Address: 127.0.0.1:8000
Referrer Policy: strict-origin-when-cross-origin
@birdietorerik admin???? Storage linking will not automagically add that segment
@tykus ou, dident now that :( Possible to fix this ?
@birdietorerik change the links config to include admin in the path
@Sinnbeck Hi!
In filesystems.php i have now:
'links' => [
public_path('storage') => storage_path('app/public'),
public_path('admin/storage') => storage_path('app/public'),
],
Is this the right way to do this ??
And try this:
php artisan admin/storage:link
But gives me error:
There are no commands defined in the "admin/storage" namespace.
@birdietorerik just storage:link
@tykus Hi!
In filesystems:
'links' => [
public_path('admin/storage') => storage_path('app/public'),
],
Then when i run -> php artisan storage:link
Get this error:
ErrorException
symlink(): No such file or directory
at vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:332
328▕ */
329▕ public function link($target, $link)
330▕ {
331▕ if (! windows_os()) {
➜ 332▕ return symlink($target, $link);
333▕ }
334▕
335▕ $mode = $this->isDirectory($target) ? 'J' : 'H';
336▕
+15 vendor frames
16 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
@birdietorerik you can't have admin/storage path as a link; only one directory depth.
@tykus Hi! How do i do this ???
You say -> change the links config to include admin in the path Where ???
@birdietorerik for the URL you want:
public_path('admin') => storage_path('app/public'),
Then inside storage/app/public/ directory; make a storage directory (if you really want http://your-domain.test/admin/storage/...
@birdietorerik set FILESYSTEM_DRIVER to public.
Hi!
Have now change my URL from
Portal.test:8000/admin/… To
Portal.test:8000/…
But image is still not shown ?????
@birdietorerik watch this. laracasts com/series/laravel-8-from-scratch/episodes/64
Please or to participate in this conversation.