Publish Laravel Site from Github

Publish Laravel Site from Github

Make sure you meet all server requirements before continue

Laravel 8 requires PHP 7.3+.

Composer must have to be installed.

First Open your GitHub repository on your web browser and copy your git URL

eg: (this is the GIT URL)

Open your server SSH – Can use putty or some hosting have there own SSH terminal

git clone GIT_URL

Browse the folder where github project folder
cd foldername

Install all package files (package.json)
composer install

Generate the key
php artisan key:generate

Copy the default settings file
cp .env.example .env

Database Connection (I have used mysql)

sudo vi .env
/** change file content **/
/** press “i”  for insert **/
Esc then :wq

Run your all migrations file
php artisan migrate

Redirect to Public Folder
Create .htaccess file and input this lines

Image Not showing issue fix
Add following code on .env file

Whenever you made any changes on your GitHub project you can run the following command to update your code on the server
git pull
username – password

Previous Post
Setup PHP 7.3/mysql/mariadb/phpmyadmin on Ubuntu 20.04 [Digitalocean Droplet]
Next Post
Make Entire Laravel Site Password Protected [Works 8.x version]