Installing Laravel 10 | MacOs | Windows | Linux

Installing Laravel 10

Installing Laravel 10 on macOS

Before you start, ensure that you have PHP and Composer installed on your local machine. If you’re developing on macOS, you can easily install PHP and Composer using Laravel Herd. Additionally, it’s recommended to have Node.js and NPM installed for frontend development.

Creating a New Laravel Project

You have two options for creating a new Laravel project: using Composer directly or using the Laravel installer.

a. Using Composer:

b. Using Laravel installer (if globally installed):

Navigate to the project directory:

Start Laravel’s local development server:

Now, you can access your Laravel application in your web browser at http://localhost:8000.

Using Laravel Sail

  1. Install Docker Desktop on your macOS machine.
  2. Open your terminal.

Creating a New Laravel Project with Sail

Run the following command to create a new Laravel project using Sail:

Navigate to the project directory:

Start Laravel Sail (Docker containers for development):

Access your application in a web browser at http://localhost.

Installing Laravel 10 on Windows

Before you begin, make sure to have Docker Desktop installed on your Windows machine. Also, install Windows Subsystem for Linux 2 (WSL2) and configure Docker to use it.

  1. Install Docker Desktop.
  2. Install and configure WSL2.
  3. Open Windows Terminal.

Creating a New Laravel Project with Sail on WSL2

Run the following command in Windows Terminal to create a new Laravel project using Sail:

Navigate to the project directory within WSL2:

Start Laravel Sail:

 

Access your application in a web browser at http://localhost.

Installing Laravel 10 on Linux

Before you start, ensure that Docker Compose is installed on your Linux machine.

  1. Install Docker Compose.
  2. Open your terminal.

Creating a New Laravel Project with Sail

If you’re using Docker Desktop for Linux, set the Docker context:

 

Run the following command to create a new Laravel project using Sail:

Navigate to the project directory:

 

Start Laravel Sail:

Access your application in a web browser at http://localhost.

Choosing Sail Services

You can customize the services in your Laravel Sail setup using the following command:

Initial Configuration

Feel free to explore the (“config /app .php”) file for various configuration options you can modify.

Databases & Migrations

If you want to use SQLite as your database driver:

Run database migrations:

Next Steps

You’re now ready to dive deeper into the Laravel ecosystem. Check out Laravel’s documentation to learn more about features and best practices. Whether you’re building a full-stack application or an API backend, Laravel provides extensive tools and resources to streamline your development process. Happy coding!

Leave a Reply

Your email address will not be published. Required fields are marked *

Chat with Bot
Open Chat
Chat with Bot
Agent is typing...

Terms & Conditions

Acepto los términos y condiciones...

Powered By A S W S S