How do you create a new Laravel project?
Creating a new Laravel project is pretty straightforward. Here's a step-by-step guide:
-
Install Composer: Laravel uses Composer to manage its dependencies. If you don’t have Composer installed, you can download and install it from getcomposer.org.
-
Install Laravel Installer (Optional): This is a global Composer package that helps in creating Laravel projects.
composer global require laravel/installer
-
Create a New Laravel Project:
- Using Laravel Installer:
laravel new project-name
- Using Composer:
composer create-project --prefer-dist laravel/laravel project-name
- Using Laravel Installer:
-
Navigate to Your Project Directory:
cd project-name
-
Set Up Your Environment:
- Copy the
.env.example
file to create a.env
file.cp .env.example .env
- Generate the application key.
php artisan key:generate
- Copy the
-
Run the Development Server:
php artisan serve
By default, this will serve your application at
http://localhost:8000
.
That’s it! You now have a new Laravel project up and running.
At Online Learner, we're on a mission to ignite a passion for learning and empower individuals to reach their full potential. Founded by a team of dedicated educators and industry experts, our platform is designed to provide accessible and engaging educational resources for learners of all ages and backgrounds.
Terms Disclaimer About Us Contact Us
Copyright 2023-2025 © All rights reserved.