Laravel does not display images in the view from storage folder
So, guys, I and a friend are working on the same project. We are using GitLab, the same repository, one branch. I used storage:link command to use a shortcut of the storage folder in the public folder of laravel.
The problem is that via this code:
<img src="/storage/public/cover_images/{{ $book->image }}"
I can see/store only my images and not the images my friend uploads, the same applies for him - he sees/stores only the images he uploads but not mine.
What might be the problem?
So you're editing the repository but you each have it installed on your machine?
Are you trying to upload something to commit it to the repository? Laravel by default ignores the storage directory when using version control. Is this what you are talking about?
@derkraizer try <img src="{{ asset('storage/cover_images/'. $book->image) }} ... > or just this which is the same without the protocol. "/storage/cover_images/{{ $book->image }}"
inspect th link in your browser where the image is suppose to be ...and check if its geting th correct url ..with a name of an image thats actually in you cover_images folder
@ZAK - What I am trying to say is that he does not get my images and I am not getting his images. I am aware of the fact that GIT does not store them but I want to be able to see his images and he should be able to see mine.
Can you see the file in the storage/app/public/cover_images folder? this should be the actual location where the files are saved assuming you used something like Storage::disk('local')->put('cover_images/' . $book->image', 'Image Contents'); to place it there. If it is there, check that the link is setup correctly.
@MAC03733 - src="/storage/public/cover_images/didi-1544606640.png" this is the link it gets. It is the same for him but still, we don't see each other's images