Laravel Storage symlink

For shared hostings try below solutions

Code:

1) Remove storage folder in public_html/public/storage

2) Create a php file for example symlink.php in public_html folder

3) Add codes to symlink.php file

$targetFolder = $_SERVER['DOCUMENT_ROOT'].'/storage/app/public';
$linkFolder = $_SERVER['DOCUMENT_ROOT'].'/public/storage';
symlink($targetFolder,$linkFolder);
echo 'Symlink process successfully completed';

4) Go to web site example.com/symlink.php

That is all...

Video url from youtube => https://www.youtube.com/watch?v=svyN8-PjGHc


when you create symlink in laravel then it create symlink of storage/app/public folder to public/storage folder. That means if you want to access any files publicly then place all your files inside storage/app/public folder and access it like this

<img src="{{asset('storage/puppy/18/test.png')}}" alt="">

Here it means the file test.png should be physically at storage/app/public/puppy/18 folder.

Execute php artisan storage:link for creating symlink in laravel

Hope it clear you


Try this one.

<img src="{{asset('puppy/18/ax2Fk08nyWrV6TwTOnsXNCkNGuIdFebB7TTfPYGb.png')}}" alt="">