Packaging a Project in Laravel — VPS | Shared Version
There are two types of packaging that can be done in laravel:
- VPS
- Shared
VPS
VPS version is for their own use and local testing. So, you would wanna keep it as close to your local system settings as possible.
- Delete all the files from app/storage/ in the following folders:
- Cache
- Log
- Sessions
- Views
2. Change your database settings in app/config/database.php to default.
3. Change your mail settings to default in app/config/mail.php and also make sure to delete your personal settings.
4. If you’ve a local folder in your app/config make sure to delete that.
Shared
Shared version is the one which e generally upload on any server as production. That doesn’t mean the VPS version won’t run on production server. It will. But it’s a good practice not to.
- Do all the steps as in VPS version.
- Copy all the files in /public/ folder and paste in the root directory, i.e. the place where your server.php lies and delete the public directory forever.
- Change the path in /bootstrap/paths.php for ‘public’ and point it towards the root directory.
- Sometimes, you might have to change the path of your bootstrap files in your index.php file and point it to your root directory too.
Now your project is ready to deploy 😄
If you like this article. click the applause button! 👏 Follow me on Github, Twitter, Facebook.