To install Laravel, you'll need to follow these steps:
1. Install Composer:
Laravel utilizes Composer, a PHP dependency manager, for installation and dependency management. You can download and install Composer from getcomposer.org.
2. Create a New Laravel Project:
Once Composer is installed, open your terminal or command prompt and navigate to the directory where you want to install Laravel. Then, run the following command to create a new Laravel project:
composer create-project --prefer-dist laravel/laravel your-project-name
Replace your-project-name with the desired name of your Laravel project.
3. Set Up Environment Configuration: Laravel requires an environment configuration file named .env. Navigate into your project directory and duplicate the .env.example file to create your .env file:
cp .env.example .env
4. Serve Your Application:
To serve your Laravel application locally, you can use the built-in development server provided by Laravel. Navigate to your project directory and run the following command:
php artisan serve
By default, the development server will start on http://localhost:8000. You can visit this URL in your web browser to see your Laravel application running.