Laravel Hello world example

In this example we will be discuss about Hello world in laravel framework.

For hello world example we need to do minimum two things.

Step 1 : go to web.php and create route.

Example :

<?php
    Route::get('/', function () {
    return view('welcome');
});

Step 2 : Create welcome.blade.php file and put the code.

<!DOCTYPE html>
<html lang="">
<head>
    <title>Hello World!</title>
</head>
<body>
    <h1> Hello World!</h1>
</body>
</html>

Step 3 : Let us execute this example by the following URL in the browser. This URL may be different based on your website.

http://localhost/blog