laraveluploaddevelopment-environmentproduction-environment

Laravel - what do I have to upload to production?


I have my site online and am developing locally. Once the changes are made, I upload the changed files to the production site. This includes obviously controllers, routes file, views, providers, policies etc... but there are 2 situations that are not entirely clear to me:

1) if I make changes to the app.js and recompile, do I only have to upload the compiled file in the public folders, or do I have to upload the sources too?

2) if I locally install a new package, for example this (my current situation): php artisan vendor:publish --provider="Spatie\CookieConsent\CookieConsentServiceProvider" --tag="lang", what files and folders do I have to update?


Solution

  • If Answer to your question.

    1. You need to upload just compiled file if you haven't any processes to compile file after upload
    2. You need to upload files that create your vendor:publish in your case, it will be language files generated. Also, you will need to do composer install on your server if it's not in your deployment process already

    In general Its easier to use other deployment tools rather than uploading manually. At least you can use git on your server to pull changes.