Lesson 02/10 · 4:34 min
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.
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?
.env
APP_URL
To be honest, I don't use Sail so not sure what could be caused by that.
I solved it! I did storage:link in the VScode terminal and not in the dock container.
Thank you for you help any way :) !
Call to a member function store() on null (
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.
Maybe you should have something like localhost:8000 and not localhost? Maybe in your
.env
file inAPP_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.
I solved it! I did storage:link in the VScode terminal and not in the dock container.
Thank you for you help any way :) !
Call to a member function store() on null (