Images only visible on my machine in Laravel + Filament project

What I am trying to do: Display images stored in Laravel using Filament, and ensure they are visible to others who clone the project. What I did: I successfully configured everything on my machine. I ran php artisan storage:link and updated the .env file with APP_URL=http://127.0.0.1:8000. The images load correctly for me. I shared the project with a friend via GitHub. My issue/the error: The images are not showing on my friend's machine, even though everything works fine for me. They cloned the repo from GitHub and also ran php artisan storage:link. Still, the images don't appear. We are both running the project locally. What could be causing this issue?
29 Replies
awcodes
awcodes6d ago
The storage directory is excluded in your .gitignore
AkuaFR
AkuaFROP6d ago
No description
AkuaFR
AkuaFROP6d ago
line 6 and 7?
awcodes
awcodes6d ago
Does the storage directory and sub directories exist when you look at the repo on github? Typically all of storage is excluded from git.
AkuaFR
AkuaFROP6d ago
No description
awcodes
awcodes6d ago
Not talking about the symlink in public. Talking about the actual storage directory at the root. Also weird that GitHub is tracking a symlink.
AkuaFR
AkuaFROP6d ago
i need help bro :/
AkuaFR
AkuaFROP6d ago
No description
awcodes
awcodes6d ago
Right but that’s a symlink which exists on the machine. Again not what I’m asking. On GitHub, does the storage directory have all the files. /storage not /public/storage Symlinks shouldn’t even be in github. Something is off in your codebase.
AkuaFR
AkuaFROP6d ago
I don't have any files on my github according to public/storage can u help me bro?
awcodes
awcodes6d ago
I think you’re not understanding what I’m saying.
AkuaFR
AkuaFROP6d ago
im using translate i speak spanish jeje
awcodes
awcodes6d ago
Ignore public/storage for now. What does /storage show in your github repo.?
AkuaFR
AkuaFROP6d ago
No description
awcodes
awcodes6d ago
And inside app? In that directory.
AkuaFR
AkuaFROP6d ago
awcodes
awcodes6d ago
Ok. Thats the problem, files you are putting into storage/app are not getting committed to the repo which is why when your coworker pulls it down they don’t have them. Even with storage:link
AkuaFR
AkuaFROP6d ago
ok i understand now
awcodes
awcodes6d ago
Storage:link creates a symlink in public to /storage.
AkuaFR
AkuaFROP6d ago
so how i can fix?
awcodes
awcodes6d ago
You have to modify your gitignore to include them
AkuaFR
AkuaFROP6d ago
i have to include public/storage and put php artisan storage:link again?
awcodes
awcodes6d ago
No, you have to change your gitignore to not ignore anything inside /storage that you want to commit. When someone pulls down the repo they will still need to run storage:link in their environment.
AkuaFR
AkuaFROP6d ago
can i call you so we can understand each other better?
awcodes
awcodes6d ago
Not somewhere I can take a call right now. Read up on the laravel docs for storage. I’m sure there’s plenty of articles about it too as it relates to git. The issue is really more of an understanding of git and not a filament or laravel thing.
AkuaFR
AkuaFROP6d ago
ooo
AkuaFR
AkuaFROP6d ago
ty bro, i will check docs and try to fix the problem if i get a problem can i ask you again?
awcodes
awcodes6d ago
Sure.

Did you find this page helpful?