How to Install Laravel 9 in Windows 10 and windows 11
Hello guys, in this article, we will learn more about Laravel 9. That means how to install a Laravel 9 via composer in your localhost system. In this article we will follow the setup installation process after how to connect your database with MySql server. Before install laravel in your system do you need to install composer for the install laravel dependency. If you don't know about the composer Click Here to know more about it.
Let's see how you will install laravel.
1. Open your server directory under the htdocs folder. After that open your terminal on the same directory. If you don't know how you will open terminal in same directory. Please see the image below. I will explain to you.
2. Now you have seen it on the top screen. Right now I am opening the htdocs folder. After opening this directory in your computer click on the top url as I will show you. After clicking on htdocs url type here cmd after entering your computer keyboard button. It will show like it. Now it is open in your directory.
3. Let's see how we will create and install a laravel project. You need to write commands in your terminal after that enter your computer keyboard.
composer create-project laravel/laravel demo_project
4. Now I have created my project under the htdocs folder. Myproject name is demo_project , If you want to change your project name please replace the name of the project.
5. After running your command. Your project has been created. I will show you.
6. After create your project. You need to click your project folder after that open env file in your editor tools. After that configure your database details on the env file. Before configuring the database you need to create a database in your PhpMyAdmin. Let's see how you will create database in your MySql server. After that we will configure database in your laravel project env file.
If you want to create a database via Query please run the below query in your MySql Server.
// Run query after change your database name
CREATE DATABASE databasename;
Example:-
CREATE DATABASE demo_project
After creating the database, open your env file from the project. After that, set your database configure details.
7.After configure your database details on your project. You need to run cmd so that laravel will create all tables in your database.
php artisan migrate
8. Let's see you have successfully configured the database and installed the laravel project. Let's see how we will run the Laravel server.
php artisan serve
9. Now your laravel server is running. copy your server url after that paste on the browser and run the project. Let's see how it will show in your browser.
Conclusion-:
In this article, we have covered the laravel 9 install process via composer. After that we have covered how to configure MySql database in your Laravel project. I hope you will understand all points.
Recommended Posts:
Laravel 9 Send Mail using queue in Laravel
How to enable the query log in laravel
Laravel change password with current password validation example
How to create Helpers function in Laravel
What is the Laravel
What Is Composer for PHP and How to Install It