There is definitely a better way, by moving all of public into the root of the project, you expose all of the app's backend code to the web. Sure it can still be protected with webserver config/htaccess rules. But this is definitely not best practice. The app code should live outside of the docroot, always.
Laravel 5.3 project deployment
Hi all, what's the proper way to deploy the Laravel 5.3 projects ? I usually use the following method to deploy the Laravel app. Step 1: ssh the server (either shared hosting or VPS.)
Step 2: cd /path/to/document_root.(public_html or /var/www/html)
Step 3:git clone https://github.com/peter279k/figlet-generator.git
Step 4: cd figlet-generator/
Step 5: download the Composer.
Step 6:php composer.phar install.
Step 7: cd public/
Step 8: download bowerphp.phar.
Step 9:php bowerphp.phar install then cd /path/to/document_root
Step 10: make sure the storage folders has the write permission.
Step 11:cp -r figlet-generator/ ../
Step 12:rm -r figlet-generator/*
Step 13: cp ../figlet-generator/public/* ./figlet-generator/
modify the index.php in ./figlet-generator
change require __DIR__.'/../bootstrap/autoload.php';
to require __DIR__.'/../../figlet-generator/bootstrap/autoload.php';
change $app = require_once __DIR__.'/../bootstrap/app.php';
to $app = require_once __DIR__.'/../../figlet-genertor/bootstrap/app.php';
Step 14: rm -rf ../figlet-generator/public
Step 15:cd ../figlet-generator
Step 16: cp .env.example .env then run: php artisan key:generate
Step 17: run: php composer.phar dumpautoload -o
Step 18: run: php artisan config:cache
Step 19: run: php artisan route:cache
Step 20: done.
Here is the link about this demonstration:
http://nttu.biz/figlet-generator/
perhaps it has the better way to deploy the Laravel projects?
Please or to participate in this conversation.