We have our Laravel project deployed in our Production server. Now in this lesson we're going to look at how we can deploy the new changes without breaking our live app and with least amount of downtime possible.
Basically we can add some features to our existing application or make some other changes based on our need. But for demo purpose I'll make small change to Navbar brand's text from this:
<a class="navbar-brand" href="{{ url('/') }}">
{{ config('app.name', 'Laravel') }}
</a>To be like this.
<a class="navbar-brand" href="{{ url('/') }}">Laravel Q/A</a>I know this is a meaningless change. But I hope you got the idea. Now we can push our local change to our remote git repository.
git add . git commit -m "Change navbar brand's text" git push origin master
Alright, let's go back to our terminal window where we login to our remote server. Make sure your working directory is in Laravel project.
Before we pull any changes we can set our application mode to down by running this command:
php artisan down
By doing this way the whole service becomes unavailable, and visitors will not interrupt us to do any deployment actions.

We can pull the changes from our remote git repository by running this command.
git pull origin master
If you made any database changes you'll also need to run database migration.
php artisan migrate
Once you get confirmation message, just answer yes and hit Enter to proceed.

Also, just in case your changes involved any third party packages you will need to install those packages in your production server by typing:
composer install
Once that done we can get the app working again by running this command.
php artisan up
Refresh the page and make sure everything still working fine.
