Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

Storage Folder: Public/Private Files and Filesystem Config

Premium
4:34

Comments & Discussion

AS
Alberto Setim ✓ Link copied!

Hi, I am trying to retrive a image using *$project->getFirstMediaUrl('projects') *

And it generate this: img src="http://localhost/storage/6/image-1.jpg" alt="Project image"

I have linked the storage folder with the artisan command. php artisan storage:link

But I am getting 404 any way. Image is uploaded successfully and in the rigth folder. I am using Sail.

I dont know what could be the problem.

PK
Povilas Korop ✓ Link copied!

Maybe you should have something like localhost:8000 and not localhost? Maybe in your .env file in APP_URL you should define that with the port?

To be honest, I don't use Sail so not sure what could be caused by that.

AS
Alberto Setim ✓ Link copied!

I solved it! I did storage:link in the VScode terminal and not in the dock container.

AS
Alberto Setim ✓ Link copied!

Thank you for you help any way :) !

SS
Smolkin Sergiy ✓ Link copied!

Call to a member function store() on null (

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.