Creating Laravel project

Installation via composer

If your computer already has PHP and Composer installed, you may create a new Laravel project by using Composer directly. After the application has been created, you may start Laravel’s local development server using the Artisan CLI’s serve command:

composer create-project laravel/laravel:^8.0 example-app
 
cd example-app
 
php artisan serve

Via The Laravel Installer

Or, you may install the Laravel Installer as a global Composer dependency:

composer global require laravel/installer
 
laravel new example-app
 
cd example-app

Install Laravel UI

composer require Laravel/ui
php artisan ui bootstrap  
OR  
php artisan ui bootstrap --auth
npm install 
&& 
npm run dev

Database Configuration

Add database name, mysql username and password in .env file.

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE= example-app
DB_USERNAME=root
DB_PASSWORD=

Run migration command:

php artisan migrate

Run Laravel App:

php artisan serve

Sponsored Content

Leave a comment