I have a Laravel project in a Homestead Vagrant environment over Windows 10.
I'm deploying the project to an Apache hosting service. For Laravel storage to work I create a link using php artisan storage:link
, that creates a link in /public
called storage with points to /storage/app/public
.
Each time I push changes to my origin master repository, the hosting automatically does a pull origin master for my project and when it happens the storage link changes to a directory. After that any uploaded photos are not found by the server and I have to delete the /public/storage
directory to recreate the symlink.
I've created a .gitignore
file in the public directory to avoid Git from changing anything for the link.
/public/.gitignore
storage
!.gitignore
I expect the link remain intact each time Git pull takes place automatically in the server.