I have the following error when moving my site to production.
The file "/home/forge/default/storage/app/geoip.mmdb" does not exist or is not readable. (View: /home/forge/default/resources/views/layouts/extra_scripts.blade.php) (View: /home/forge/default/resources/views/layouts/extra_scripts.blade.php) (View: /home/forge/default/resources/views/layouts/extra_scripts.blade.php)
It is related with this package: Torann/laravel-geoip
The default laravel .gitignore file ignores the storage folder and therefore the file is missing in production:
/vendor
/node_modules
/public/storage
Homestead.yaml
Homestead.json
.env
My question is: Should I remove /public/storage from .gitignore? Is it a good practice to include this file in my project? Is there another way to make this package work?
From my understanding after skimming the documentation, you should be able to just run php artisan geoip:update
and it will re-create the database for you. No need to keep it in your git repo.
Optimization Tip: When using the database option I don't like having the downloaded database in my git repository, so I have my deploy system run the
geoip:update
during the build process before it's deployed to the servers.