Images 404

hi all I hope someone can help. I am getting 404 on the Files I've uploaded (images). Disk is config is set to 'local'. I tried public and it worked but then anyone could view the images which I dont want. Only the logged in to the panel. I can see them uploaded to:
/storage/app/symptoms but I cannot view in my Tables\Columns\ImageColumn::make('photos')->circular()->stacked(),
/storage/app/symptoms but I cannot view in my Tables\Columns\ImageColumn::make('photos')->circular()->stacked(),
Disk: Local
FileUpload::make('photos')->directory('symptoms')->multiple()->image()->imageEditor()->moveFiles()->columnSpan(2),
FileUpload::make('photos')->directory('symptoms')->multiple()->image()->imageEditor()->moveFiles()->columnSpan(2),
Any help would be greatly appreciated Further context, this is just a personal project for my family so I don’t need to use s3 storage. But equally as this is on a site ( behind login ) i don’t want to use fully public storage.
Solution:
Thank you. I’m remember that one. I ended up setting up an s3 storage instance and using that in the end
Jump to solution
26 Replies
Yacoub Al-haidari
Hey bro , make sure that you linked the storage in to public " php artisan storage:link" and if you run you project using php artisan serve . you have to add this in your .env file . APP_URL=http://127.0.0.1:8000
David | Fortune Validator
Thank you for the advice. I did try this and the
php artisan storage:link
php artisan storage:link
fixed it when I used 'public' disk but it wont work with local. Both local and production arent working so its not the URL
Yacoub Al-haidari
if you want to display the image in the balde you can make this "<img src="{{asset('storage/'.post->image)}} > it will work .
David | Fortune Validator
its to show pictures of foods/symptoms which i ideally want viewed on the table which shows each day its a logging symptom for my kids allergies am I thinking i need to pay for s3 to get this functionality? I kind of thought 'local' would be okay so long as I was logged in.
Yacoub Al-haidari
for s3 has limitation but i don't know the limit. Is it okay if you use local ? By the way , You can store the images locally on your device or on a local server. This approach doesn't require any additional costs, but it means the images will only be accessible from the device or server where they are stored and if you use the share hosting keep the filesystem as local its okay
David | Fortune Validator
I would prefer to use local yes. But I don’t want the image links available to public. And the FileUpload Column doesn’t seem to display the thumbnails of the images on the table when set to local. This is my problem :/ I only want those logged in to be able to view the thumbnails on the table. Hence I cannot use the public disk
Yacoub Al-haidari
Hi , would please provide me photo for the link that appear in the table ?
Yacoub Al-haidari
this is my file env in share hosting
No description
David | Fortune Validator
APP_URL=https://allergy_tracker.test This is on a local 'herd' setup. Same issue occurs on production ( I have updated SITEURL to reflect production. Same issue) FILESYSTEM_DISK=local FILAMENT_FILESYSTEM_DISK=local
Yacoub Al-haidari
inspect image url
Yacoub Al-haidari
Now Go to public folder in your public_html and remove the storage folder and try to make
php artisan storage:link
php artisan storage:link
David | Fortune Validator
okay one moment INFO The [public/storage] link has been connected to [storage/app/public].
Yacoub Al-haidari
Did you remove it ?
David | Fortune Validator
yes I'll try again to be sure
Yacoub Al-haidari
oaky
David | Fortune Validator
no change
Yacoub Al-haidari
after you remove the storage folder from public folder try again to run this
php artisan storage:link
php artisan storage:link
again
David | Fortune Validator
I did. it outputs.
The [public/storage] link has been connected to [storage/app/public].
The [public/storage] link has been connected to [storage/app/public].
it seems that it is always just linking the public folder which makes sense I suppose
Yacoub Al-haidari
okay
David | Fortune Validator
I obviously dont want my images to be public only for those logged into the panel. e.g no one should be bale to use a URL to access the image. Maybe its a temp URL setup that is needed, like S3 opperates but within local
Yacoub Al-haidari
you mean looks like this
No description
David | Fortune Validator
So I’ve just taken a look at the pricing for s3 buckets and for my usage I’m looking at 1-3 cent per month. Seems like that may just be the easier solution. Also I won’t loose any images if hosting goes bad Thank you ever so much for your help so far.
Yacoub Al-haidari
you are welcome
Dennis Koch
Dennis Koch5mo ago
You need to set up a temporary url for your local storage then and link it with a controller that outputs your images when authenticated
Solution
David | Fortune Validator
Thank you. I’m remember that one. I ended up setting up an s3 storage instance and using that in the end