Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cloning laravel project from github

I'm new to GitHub and I found this site very useful for a lot of us. I came upon storing my Laravel project here in GitHub, but there's a problem every time I will clone it to be able to go to production, when I'm about to clone it at first, it always shows this error.

Warning: require(C:\xampp\htdocs\tourismPortal\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\tourismPortal\bootstrap\autoload.php on line 17  Fatal error: require(): Failed opening required 'C:\xampp\htdocs\tourismPortal\bootstrap/../vendor/autoload.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\tourismPortal\bootstrap\autoload.php on line 17 

I know this will be solved by using composer update on it, but is there any way to prevent this error so that every time I clone it, I will go to production without encountering this error? Thanks, by the way, I'm using tortoisegit to clone, pull and push.

like image 512
SMPLYJR Avatar asked Jul 27 '16 01:07

SMPLYJR


2 Answers

  • Clone your project
  • Go to the folder application using cd command on your cmd or terminal
  • Run composer install on your cmd or terminal
  • Copy .env.example file to .env on the root folder. You can type copy .env.example .env if using command prompt Windows or cp .env.example .env if using terminal, Ubuntu
  • Open your .env file and change the database name (DB_DATABASE) to whatever you have, username (DB_USERNAME) and password (DB_PASSWORD) field correspond to your configuration.
  • Run php artisan key:generate
  • Run php artisan migrate
  • Run php artisan serve
  • Go to http://localhost:8000/
like image 74
Conor Avatar answered Sep 30 '22 17:09

Conor


Yes you can, but that is not recommended at all.

You can delete everything in .gitignore file and push them from a working project. Then it will work perfectly where you git clone them.

But there are so many drawbacks in this way. I recommend you not to do that.

like image 40
Rafik Farhad Avatar answered Sep 30 '22 17:09

Rafik Farhad