Whenever we perform an import operation by git clone command on a terminal for Laravel project, generally we face some problem for launching the Laravel project directly on the browser. We need to perform some terminal commands to see the actual UI and working of Laravel Project imported through git clone command.
Let’s see what terminal commands we need to perform after taking a clone of the laravel project from GitHub/GitLab.
- Go to the laravel project directory in the terminal using the cd command. For example:
- Run the composer update command for the laravel project assuming composer is already installed on your system.
- Then we need to generate an application key for the laravel project in the .env file. If the .env file does not exist in the Laravel project, then create it and copy all contents from the .env.example file in the .env file. Now, we will generate the application key by the following command:
php artisan key:generate
With the above command, you will observe that a key has been added at the APP_KEY attribute in the .env file which was blank initially.
- Then clear the cache using the following command
php artisan config:cache
With the above command, a success message will be shown on the terminal.
- Now, run the last artisan command to view the working UI of the Project.
php artisan serve
With the above command, the following message is shown on the terminal
Laravel development server started: http://127.0.0.1:8000
- Now, open the browser and copy the link (http://127.0.0.1:8000) shown in the above message on the browser and you will be able to see your git imported laravel project.
StudySection has a long list of certification exams that it offers through its online platform. The PHP Certification Exam is one of the programming certifications that it provides. Whether you are new to PHP programming or you have extensive experience in PHP programming, you can get a certification according to your level. Attach a PHP certification with your resume to get the most out of job offers.