Creating a new laravel project
To create a new Laravel project, you can use the following steps:
Method 1: Using Composer
- Open your terminal or command prompt.
- Run the following command to create a new Laravel project:
composer create-project --prefer-dist laravel/laravel project-name
Replace
project-name
with the desired name of your project.
Method 2: Using Laravel Installer
- Open your terminal or command prompt.
- Run the following command to install Laravel:
composer global require laravel/installer
- Once installed, navigate to the directory where you want to create your project and run:
laravel new project-name
Replace
project-name
with the desired name of your project.
Method 3: Using Laravel's Official Website
- Go to the Laravel website (www.laravel.com) and click on the "Create a New Project" button.
- Fill in the required information, such as project name, namespace, and email address.
- Click on the "Create Project" button to download the project files.
Common Steps
Regardless of the method you choose, you'll need to follow these common steps:
- Change into the project directory:
cd project-name
- Install the dependencies:
composer install
- Configure the environment variables:
cp.env.example.env
- Run the database migrations:
php artisan migrate
- Start the development server:
php artisan serve
- Open your web browser and navigate to
http://localhost:8000
to see your new Laravel project in action!
That's it! You now have a brand new Laravel project set up and ready to go.