Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setup Laravel project after cloning

Tags:

php

laravel

So I have just cloned big repo with Laravel project, for the moment this folder (lets call it /var/www/project) does not have vendor folder, .env file, autoload files etc.

Is there some kind of detailed united tutorial with all the steps what should I do next? Install composer (it is already installed on my computer, I have other working projects), generate autoload files and vendors?

Which commands should I run in my console (I have Ubuntu 14.04) to make this folder a working virtual host? Or could someone be so kind to give me all the instructions?

like image 961
Coffee Avatar asked Jul 18 '16 12:07

Coffee


5 Answers

  1. run composer install to generate depedencies in vendor folder
  2. change .env.example to .env
  3. run php artisan key:generate
  4. configure .env

basiclly you need do these things, more info you should check docs

like image 87
Raymond Cheng Avatar answered Nov 12 '22 23:11

Raymond Cheng


Windows

Go to the project folder
Shift+Right Click -> Open command window here

Mac

Open Terminal, Type "cd " (with a space)
From finder, Drag the project folder
Press Enter to go inside the project folder

Compose

composer install

Generate Key

php artisan key:generate

Setup Database

Open the file .env
(Assuming wamp or xampp)
Edit values to match your database
Add empty database using phpmyadmin
Include that name in the DB_DATABASE

DB_HOST=localhost
DB_DATABASE=students_data
DB_USERNAME=root
DB_PASSWORD=

Get Tables

php artisan migrate

Get default/initial/dummy table values

php artisan db:seed

Run the project

php artisan serve
like image 43
Abdul Saleem Avatar answered Nov 12 '22 23:11

Abdul Saleem


  • Install Docker Desktop. See https://laravel.com/docs/8.x/installation for details.

  • Change working directory to project dir.

  • Set up sail dependencies:

    docker run --rm \
        -v $(pwd):/opt \
        -w /opt \
        laravelsail/php80-composer:latest \
        composer install
    

    See https://laravel.com/docs/8.x/sail#installing-composer-dependencies-for-existing-projects for details.

  • Run the docker container:

    vendor/bin/sail up
    
  • Connect to MySQL container shell:

    vendor/bin/sail exec mysql bash
    
  • Inside that shell, create the database:

    mysql --password= --execute='create database yourDatabaseName'
    exit
    
  • Connect to Laravel container shell:

    vendor/bin/sail bash
    
  • Copy .env file:

    cp .env.example .env
    
  • Generate application key:

    php artisan key:generate
    
  • Seed the database:

    php artisan migrate:fresh --seed
    
  • Visit the site on host machine: http://localhost

like image 30
whyer Avatar answered Nov 12 '22 22:11

whyer


1. clone the repo
git clone <l_repo>

2. go into the repo
cd l_repo

3. install require packages
composer install

4. generate the laravel project key
php artisan key:generate

5. migrate and seed at the same time
php artisan migrate:fresh --seed

6A. convert ".env.example" to ".env"

6B. change the 'database name' & 'username' & 'password'
DB_HOST=localhost DB_DATABASE=own_databse_name DB_USERNAME=root DB_PASSWORD=

7. Change the file upload limit for php.ini
upload_max_filesize = 4G post_max_size = $4G

8. Link with storage
php artisan storage:link

9. start the server
php artisan serve

like image 2
kamalesh biswas Avatar answered Nov 13 '22 00:11

kamalesh biswas


Follow the Install Laravel documentation: https://laravel.com/docs/5.2#installation

like image 1
Sitethief Avatar answered Nov 12 '22 22:11

Sitethief