lirone's avatar

Document storage and production - How to store PDF data in production ?

Hi,

I'm happy and pretty excited because I almost deployed successfully my first app in production using Heroku. However, I still need help for something that may be simple.

I have created an app where user can see some information from PDF files and download them.

For exemple info1.pdf - info2.pdf, etc.

On my local environment, I have created a folder in storage/app/public called data and inside data, two others folder called cover and PDF. So storage/app/public/data/cover and storage/app/public/data/pdf

Inside the cover folder, I have cover images related to each PDF and inside PDF all my PDF files.

So far so good, I have created a seeder in Laravel with the help of Laravel Excel Import to generate my DB with those data. It works well on local.

However, after deploying on production, I noticed that my storage/app/public is empty. Of course, there is a .gitignore file that was by defaut if I remember well.

So I'm stuck.

  • Do I need to remove the .gitignore file and upload my data so I can do the manipulation like in local
  • Or is there another way, more convenient to generate my DB using those data (PDF and cover)

I precise that I did as well the following command line: php artisan storage:link

I don't know if it could help but I did that on my filesystems.php

   'data' => [
            'driver' => 'local',
            'root' => storage_path('app/public'),
            'url' => env('APP_URL') . '/storage/data',
        ],

thank for your help ! I would very appreciate !

0 likes
4 replies
lirone's avatar

Thank you ! I have already created a controller that allows only an auth user to download it. My question however, if do I still to upload my files from storage/app/public to my server in production to be able to use my seeder ? thank you

lirone's avatar

@jlrdw yes, actually, I need to generate/populate my database with some data from PDF files.

Please or to participate in this conversation.