Hi Artisan, today I am going to explain you how to install Laravel 11 with composer. I will explain and show step by step to install composer and Laravel project. To install the Laravel 11 PHP framework from scratch, follow these detailed steps. Before starting, ensure your system meets Laravel 11's technical requirements, which include a compatible PHP version, web server, and database support:
Before we can download laravel we have to download composer and install it. If you already installed composer, you can check composer version run command below:
composer --version
Launch command prompt (cmd), and run command as below
composer create-project laravel/laravel:^11.0 Laravel11
This will generate a project named Laravel11
in your current directory, along with all necessary dependencies. Now navigate to project directory
cd Laravel11
To check your Laravel version with command below:
php artisan --version
Output:
Laravel Framework 11.34.2
In Laravel root directory you will see a file named .env. There is a few configuration related to your credential information. Set database credentials (DB_DATABASE
, DB_USERNAME
, and DB_PASSWORD
) for your environment.
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database_name
DB_USERNAME=your_database_username
DB_PASSWORD=your_database_password
To create necessary tables, use:
php artisan migrate
Now we can run launch the local server with command
php artisan serve
Then we can go to browser and see first home page laravel project via http://localhost:8000
Hope you can install successfully and run Laravel project. Thanks
As the founder and passionate educator behind this platform, I’m dedicated to sharing practical knowledge in programming to help you grow. Whether you’re a beginner exploring Machine Learning, PHP, Laravel, Python, Java, or Android Development, you’ll find tutorials here that are simple, accessible, and easy to understand. My mission is to make learning enjoyable and effective for everyone. Dive in, start learning, and don’t forget to follow along for more tips and insights!. Follow him