In this article, we will learn how to change the default view file and also we learn the routes folder.


find views directory

resources/
┗ views/
  ┗ welcome.blade.php


Create your own view, I am creating sample.blade.php and you put your html code

resources/
┗ views/
  ┗ welcome.blade.php
 ┗ sample.blade.php

sample.blade.php

<!DOCTYPE html>
<html>
    <head>
        <title>Page Title</title>
    </head>
    <body>
        <h1>Hello world!</h1>
    </body>
</html>


Change the Default view

go to routes directory and find web.php here we will replace welcome to sample views


routes/
┗ web.php


web.php

<?php

use Illuminate\Support\Facades\Route;

//here we can set our default view
Route::get('/', function () {
    return view('sample');
});


Output:

Hello world!