Laravel 9 Installation from basic and changing the welcome page
Laravel is a PHP web application open-source framework created by Taylor Otwell in 2011 and it follows the Model-View-Controller (MVC) architecture like all other modern frameworks, If you are thinking of building a PHP-based web application then laravel is the best option nowadays.
In this article, we are going to install laravel via composer and we will write our first view and we will test it in the browser.
What you should know before starting laravel:
- Basic knowledge of PHP
- Basic knowledge of Terminal or Command Prompt
- Basic knowledge of HTML
System requirements:
- You should have xamp or wamp installed in your system
- You should have composer installed in your system because for managing dependencies laravel uses composer you can install composer by clicking here.
- a code editor installed in your system I prefer visual code editor
Now we will start step by step installation process:
step 01: First we installed composer as described above and after composer installation open command prompt or terminal and type
composer
if you are seeing the below screen that means you have installed composer.
C:\Users\Admin>d:
D:\>cd xamp
D:\xamp>cd htdocs
D:\xamp\htdocs>
Then type the below command it will take some time according to your net speed and it will install laravel in your system.
D:\xamp\htdocs>composer create-project laravel/laravel first-laravel-project
Now, if everything is ok then you have a new folder called first-laravel-project just open that folder. You will see there a lot of files and folders are already present, this is actually the Laravel framework itself.
And now we will start our server, so type the bellow command inside your project in the command line.
D:\xamp\htdocs\first-laravel-project>php artisan serve
If everything is ok then it will automatically open your default browser if not just open chrome and type 127.0.0.1:8000
you will see the laravel welcome page like below if you are seeing the below screen that means you have done the installation
That's all about laravel installation.
Step 04: Now we will see how we can change our default welcome page content
now we will edit the welcome page view and will write some text just open vs code editor and goto first-laravel-project > resources > view folder and open welcome.blade.php and edit it and save it.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
</head>
<body>
<h1> My first laravel project</h1>
</body>
</html>
Goto the browser refresh you can see the changes below.
I hope you all have installed laravel successfully if is there anything I have missed or you are getting any errors you can comment below or contact me via the contact form.