Laravel 10 Installation: Step-by-Step with Requisites

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:

  1. Create a Project Directory: Choose a directory where you want to install your Laravel application.

  2. all Laravel using Composer: There are two ways to do this:

    a) Using Laravel Installer:


    composer global require "laravel/installer"

    laravel new your-project-name

    b) Using Composer Create-Project:

    composer create-project laravel/laravel your-project-name

  3. Navigate to your Laravel Project:

    cd your-project-name

  4. Install Dependencies:

    composer install

  5. Generate an Application Key:

    php artisan key:generate

  6. 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.

  7. Run Migrations:

    php artisan migrate

  8. Start the Development Server:

    php artisan serve

  9. 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.