Today I will show you how to clone the laravel project on github and install it on a local environment.
Note : Your device must have apche or nginx installed, mysql, php, npm (node), git.
Start.
In this article I use the following repository: https://github.com/rappasoft/laravel-5-boilerplate
Step 1: Open Terminal and execute the project clone and go to the project directory with the following command:
1 2 3 | git clone https://github.com/rappasoft/laravel-boilerplate.git cd laravel-5-boilerplate |
Step 2: Run composer and npm to install the necessary packages in the project
1 2 3 | composer install npm install |
Step 3: Create database and config database
Go to mysql workbech or adminer to create a new database
For example, create a database named : laravel-5-boilerplate
Then we issue the following command to copy the env file:
1 2 | cp .env.example .env |
Update your env file as follows:
1 2 3 4 5 6 7 | DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel-5-boilerplate DB_USERNAME=root DB_PASSWORD= |
Step 4: Generate a key for the project
1 2 | php artisan key:generate |
Step 5: Create tables and sample data for the database
1 2 3 | php artisan migrate php artisan db:seed |
Step 7: Building styles and scripts
1 2 | npm run <command> |
The available commands are listed at the top of the package.json file under the ‘scripts’ keyword.
Step8: Storage: link
1 2 | php artisan storage:link |
After installing the project you must run the above command to publicize your archive directory when the user uploads the image.
Step 9: Run Phpunit ( https://github.com/rappasoft/laravel-5-boilerplate )
After your project is installed, run phpunit . to ensure all functions are working correctly.
From the root of your project run:
1 2 | phpunit |
Step 10: Login to the project
After installation is complete and you can go to the browser and log into the project with the following data:
1 2 3 | Username: <a class="__cf_email__" href="/cdn-cgi/l/email-protection" data-cfemail="8cede8e1e5e2ccede8e1e5e2a2efe3e1">[email protected]</a> Password: secret |
Other projects also clone and perform the same steps as above
Good luck
The article is brief and translated from: https://forum.laragon.org/topic/175/tutorial-how-to-work-with-laravel-projects-on-github