search

Home  >  Q&A  >  body text

Php artisan storage: link to delete stored files (DigitalOcean)

Case: I uploaded a Laravel project on DigitalOcean using the following command in the Yaml file

run_command: |- 
php artisan migrate --force
php artisan storage:link
heroku-php-apache2 public/

Problem: Every time you deploy, these commands are run and the storage files are deleted. How to deploy without deleting uploaded files?

Additional Information:- 1-Table records are not deleted, only uploaded files are deleted 2- imagePath: base_url/storage/images/products/imageName.png

P粉790819727P粉790819727237 days ago457

reply all(1)I'll reply

  • P粉567112391

    P粉5671123912024-03-30 16:28:33

    Solution: This is not a problem. The problem is that every time you deploy, DigitalOcean is deployed on a different server (container) every time, so it's like a new device. But the table is not cleared, just the stored stuff

    reply
    0
  • Cancelreply