How to create a Laravel project
How to create a New Laravel project
- Open command prompt and execute below command
composer create-project --prefer-dist laravel/laravel projectname
![](https://blogshub.co.in/wp-content/uploads/2022/08/image-10.png)
It will create a directory with Laravel files.
- Create a new Database for configuration Laravel application
- Open the .env file in any code editor, and set DB credentials
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel_api
DB_USERNAME=root
DB_PASSWORD=
Now run you application using below command
php artisan serve
![](https://blogshub.co.in/wp-content/uploads/2022/08/image-11.png)
After running the command it will give a URL like : http://127.0.0.1:8000
You can access you application using this URL
![](https://blogshub.co.in/wp-content/uploads/2022/08/image-12.png)
For create tables in database run below command
php artisan migrate
![](https://blogshub.co.in/wp-content/uploads/2022/08/image-13.png)