Courses

File Uploads in Laravel

Storage Folder: Public/Private Files and Filesystem Config

avatar

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.

avatar

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.

avatar

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

avatar

Thank you for you help any way :) !

avatar
You can use Markdown
avatar

Call to a member function store() on null (

avatar
You can use Markdown
avatar
You can use Markdown