Install Laravel: Composer or Laravel Installer
# Laravel 11 For Beginners
In this first lesson, we will create a new project using Laravel. The official Laravel documentation on the installation page provides detailed guidance. However, there are multiple ways to install Laravel.
The official documentation primarily focuses on a tool called Laravel Sail, which is built on Docker. However, in this course, we won’t be using Sail. This is because Sail requires at least basic knowledge of Docker, and we want to keep things simple for beginners.
My personal preference for this course is to use the Laravel Installer.
Before we proceed with the installer, let’s make sure your machine is properly set up.
Setting Up Your Computer: Composer and a Web Server
To install Laravel, the first step is to install Composer on your machine. Composer will be used to manage Laravel’s dependencies and packages.
Next, you’ll need a PHP web server installed on your machine. Depending on your operating system, there are several bundled tools available that include essential components like Nginx/Apache, PHP, MySQL, and more for PHP web projects. Some popular options include:
- Laravel Herd (macOS)
- Laravel Valet (macOS/Linux)
- Laragon or XAMPP (Windows)
On my machine, I’ll be using Laragon, as it’s my preferred setup.
Note: Laravel 11 requires PHP version 8.2 or higher.
Install and Launch Laravel
First, you need to install the Laravel Installer globally using Composer. Run the following command:
After the installation, you can create a new Laravel project using the following command:
This will create a new folder named with all the necessary Laravel files inside.
For simplicity, let’s create a project named :
This command will create a new Laravel project inside a folder.
If you're using Laragon, it will automatically generate a local domain like , which you can open directly in your browser.
Installation Options
When you run the Laravel Installer, you might be presented with a few options to customize your project setup:
-
Starter Kit:
For now, do not select any starter kit like Breeze or Jetstream. We’ll cover these in later lessons. -
Testing Framework:
During this course, it doesn’t matter whether you choose PHPUnit or Pest. Testing will be discussed in a separate course. -
Database Engine:
You can choose SQLite, MySQL, or another database engine based on your preference.
Default Database: SQLite
By default, Laravel uses SQLite as its SQL database engine. Once the Laravel project is created, an SQLite database file will be automatically generated in the folder. The database structure will be built from the Migration files, which we’ll discuss in more detail later in this course.