Laravel image not found in public/storage
P粉043566314
P粉043566314 2023-08-26 20:51:28
0
1
587
<p>I'm trying to access images for my project. </p> <p>I have run php artisan storage link</p> <p>Laravel Create Public/Storage</p> <p>When I upload an image to storage/app, I see the image in storage/app but not in public/storage. </p> <p>When I try to view the image on my browser, I get an error 404</p> <p>controller.php</p> <pre class="brush:php;toolbar:false;">Property::create([ 'SittingRoom'=> request()->file('sittingroom')->store('apartments') ]);</pre> <p>bladeview.php</p> <pre class="brush:php;toolbar:false;"><img src="{{asset('storage/'.$duplex->SittingRoom)}}"></pre> <p>Browser link</p> <pre class="brush:php;toolbar:false;">http://127.0.0.1:8000/storage/apartments/HNLDysVUdRG7ZTBkF2qFGk2B2tAKYzYcVImNEWLx.jpg</pre> <p>After running artisan storage link</p> <p>C:xampphtdocsOPAAM> php artisan storage: link</p> <p>Message [C:xampphtdocsOPAAMpublicstorage] link is connected to [C:xampphtdocsOPAAMstorageapp/public]. </p>
P粉043566314
P粉043566314

reply all(1)
P粉420868294

The problem isconfig/filesystems.php

'default' => env('FILESYSTEM_DISK', 'public'),

But in the .env file

FILESYSTEM_DISK=local

This configuration will save your images in Storage/app instead of storage/app/public.

Images saved in storage/app are not publicly accessible. So you have to change the .env file

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template