Before diving into the installation steps, let's review the requirements to ensure a smooth process:
Requisites:
- PHP 8.0+: Laravel 10 requires PHP 8.0 or later. You can check your existing PHP version by running php -v in your terminal.
- Composer: Composer is the dependency manager for Laravel. You can download and install it based on your operating system from https://getcomposer.org/.
- Web Server: You'll need a web server like Apache or Nginx to run your Laravel application.
- Database: Laravel requires a database like MySQL, PostgreSQL, or SQLite. Choose one and ensure it's properly configured.
- Terminal: You'll need a terminal to execute commands for installation and configuration.
Installation Steps:
-
Create a Project Directory: Choose a directory where you want to install your Laravel application.
-
all Laravel using Composer: There are two ways to do this:
a) Using Laravel Installer:
composer global require "laravel/installer"
laravel new your-project-nameb) Using Composer Create-Project:
composer create-project laravel/laravel your-project-name
-
Navigate to your Laravel Project:
cd your-project-name
-
Install Dependencies:
composer install
-
Generate an Application Key:
php artisan key:generate
-
Configure Database:
Edit the .env file to set your database credentials and other configurations. Refer to the Laravel documentation for specific instructions based on your chosen database.
-
Run Migrations:
php artisan migrate
-
Start the Development Server:
php artisan serve
-
Access your Laravel Application:
Open your web browser and navigate to http://localhost:8000 (or the port you specified in your .env file). You should see the Laravel welcome page.