#Images only visible on my machine in Laravel + Filament project

41 messages · Page 1 of 1 (latest)

honest notch
#

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?

gentle lanceBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

mighty kettle
#

The storage directory is excluded in your .gitignore

honest notch
honest notch
mighty kettle
#

Does the storage directory and sub directories exist when you look at the repo on github?

#

Typically all of storage is excluded from git.

mighty kettle
#

Not talking about the symlink in public.

#

Talking about the actual storage directory at the root. Also weird that GitHub is tracking a symlink.

honest notch
#

i need help bro :/

mighty kettle
#

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.

honest notch
#

I don't have any files on my github according to public/storage

#

can u help me bro?

mighty kettle
#

I think you’re not understanding what I’m saying.

honest notch
#

im using translate

#

i speak spanish

#

jeje

mighty kettle
#

Ignore public/storage for now. What does /storage show in your github repo.?

honest notch
mighty kettle
#

And inside app? In that directory.

honest notch
mighty kettle
#

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

honest notch
#

ok

#

i understand now

mighty kettle
#

Storage:link creates a symlink in public to /storage.

honest notch
#

so how i can fix?

mighty kettle
#

You have to modify your gitignore to include them

honest notch
#

i have to include public/storage and put php artisan storage:link again?

mighty kettle
#

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.

honest notch
#

can i call you so we can understand each other better?

mighty kettle
#

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.

honest notch
#

ooo

mighty kettle
honest notch
#

ty bro, i will check docs and try to fix the problem

#

if i get a problem can i ask you again?