Setup Laravel project after cloning
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=localhostDB_DATABASE=students_dataDB_USERNAME=rootDB_PASSWORD=
Get Tables
php artisan migrate
Get default/initial/dummy table values
php artisan db:seed
Run the project
php artisan serve
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