Title: Storage Linking Issue in Laravel 8 on localhost
Tags: php;laravel;upload;localhost;laravel-8
Question: 
Laravel Version: 8.35.1
PHP Version: 8.0.0

Description:
I'm uploading an image with laravel using this code:
```$product_image = $request-&gt;file('product_image');
$product_image_extension = $product_image-&gt;extension();
$product_image_name = time() . '.' . $product_image_extension;
$product_image-&gt;storeAs('/media/product_images', $product_image_name);
$model-&gt;product_image = $product_image_name;
```
It works fine, the file is uploaded to storage/app/media/product_images/.
Then, I run the command
```
php artisan storage: link
```
to create the symlink in public.
The Command Execute Like this:
```Local NTFS volumes are required to complete the operation.
The [E:\Complete Programming Bootcamp\laravel Work\ecom-project\cyber_shopping\public\storage] link 
has been connected to [E:\Complete Programming Bootcamp\laravel Work\ecom- 
project\cyber_shopping\storage\app/public].
The links have been created.
```
I am Using This Code To Display Image:
```{{asset('storage/media/product_images/' . $list-&gt;product_image)}}
```
But Image is not displaying on the frontend.
Also, The Storage Folder Is not created in the public folder.
PLz, Help Me.
Thanks

Comment: try to access that image directly from browser, does the image accessible from that url?

Comment: Try this rm -rf public/storage Then run php artisan storage:link

Comment: You have to store the files under `storage/app/public/media/product_images/` to make them publicly accessibles through `asset('storage/media/product_images/' . $list->product_image)`. So change `$product_image->storeAs('/media/product_images', $product_image_name);` to ` $product_image->storeAs('public/media/product_images', $product_image_name);`

Comment: yes, I try this but the page not found error occurs. When I Copy the storage/app/public/[media(this folder)]  paste it in the public/storage(created by myself) folder the images displayed. But This process is not dynamic. I need that when I upload an image it also stores in the public/storage folder and the display.

Comment: I try this, but it does not work for me.

Comment: Everything works fine. The issue is 1) images are stored in the storage/app/public/media folder but not in the public/storage folder. 2) There is no folder in public with name storage after execution of `php artisan storage: link`. When I copy all images from storage/app/public/media and paste them in public/storage(created by myself)/media/ Then all images display this process is static i want to do it dynamically. i tried many queries but it not works.

Here is the accepted answer: According to https://github.com/photoncms/cms/issues/8, you are trying to symlink on fat32 drive on which it does not work. Try to test it on NTFS drive

Comment for this answer: Thanks, This Problem is solved by running the command `php artisan storage:link` on the NTFS drive. Now Everythings Goes Right.

Here is another answer: Step 181a:6c1c:918f:f3a4:2e8c:61d6:1a08:6b16 Store Image
```$path = ‘’;
if( $request-&gt;has('product_image') ) {
    $path = $request-&gt;file('product_image')-&gt;store('media/product_images');
}
$model-&gt;product_image = $path;
```
Step 181a:6c1c:918f:f3a4:2e8c:61d6:1a08:6b16 Check Store File Path
The File Will Be Store In Path181a:6c1c:918f:f3a4:2e8c:61d6:1a08:6b16
————————————————————————————————
```Storage/app/public/media/product_images/
```
Step 181a:6c1c:918f:f3a4:2e8c:61d6:1a08:6b16 Link Storage In Public Folder
Run The Storage Link Command and remove storage link folder from the public if already exist
```php artisan storage:link
```
Step 181a:6c1c:918f:f3a4:2e8c:61d6:1a08:6b16 Create Global Function To Access Images Main Controller.php File Create Global Storage Image Getting Function Like This
```public static function getUrl($path)
{
    $url = &quot;&quot;;
    if( !empty($path) &amp;&amp; Storag181a:6c1c:918f:f3a4:2e8c:61d6:1a08:6b16disk('public')-&gt;exists($path) )
        $url = Storag181a:6c1c:918f:f3a4:2e8c:61d6:1a08:6b16url($path);
    return $url;
}
```
Step 181a:6c1c:918f:f3a4:2e8c:61d6:1a08:6b16 Use Function In Assest To Display Image
```<img src=&quot;{{ getUrl($list-&gt;product_image) }}&quot; /&gt;
```

Comment for this answer: what is the image src path?
Comment for this answer: Thanks, Brother To Help Me. But Image is Still Not Found
Comment for this answer: {{asset('storage/media/product_images/' . $list->product_image)}}  => admin/storage/media/product_images/shirt.png

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 6, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2021:00:04/08/21', 'FavoriteCount': 2.0, 'PostTypeId': 1, 'Tags': '<php><laravel><upload><localhost><laravel-8>', 'Title': 'Storage Linking Issue in Laravel 8 on localhost', 'ViewCount': 3129, 'id': 66996454, 'user_AboutMe': '<p>I Am a Full Stack Developer</p>\n', 'user_AccountId': 19354036.0, 'user_DisplayName': 'msaad dev', 'user_Reputation': 21.0, 'user_Views': 13.0, 'user_id': 14150718.0}}