I have a site that uses envoyer for deployment.
On my site users can save images/avatars/etc. These images are saved to the public path of laravel. /public/uploads/
The problem with this is that when I deploy an update, composer doesn't keep the new files in /public/uploads in the new release folder.
Is it to write a deployment script that'll copy everything from /public/uploads in the current release INTO the new release every time I push a new deployment?
Don't store them in
public/uploads, store them instorage/uploads. Symlinkstorage/uploadsto/public/uploadsand movestorage/uploadsout of the project completely into it's own directory. Then symlink/storage/uploadsto your own/storage/uploads, something like this:Make sure that the ownership of the new directory located at
/home/forge/storage/example.com/uploadsmatches to your ownership of/home/forge/example.com.This will allow persistence of storage on the device. Ensure that the
symlinksare added to part of the deployment process, and you'll no longer lose your uploads each time you deploy.