AmarjaPatil4
AmarjaPatil4

Reputation: 1650

Add HTML page in Laravel

Is it necessary to use blade file in laravel or we can add .html page for UI purpose and if yes then how to do this.

This sounds like a stupid question, but still I want to know about this.

Upvotes: 4

Views: 3037

Answers (1)

Gopal Kildoliya
Gopal Kildoliya

Reputation: 649

You can use HTML file but it should be a .php file. Like-

<!-- View stored in resources/views/greeting.php -->

<html>
    <body>
        <h1>Hello, <?php echo $name; ?></h1>
    </body>
</html>

You have this greeting.php file of view show you can call this in your controller and pass values like the following.

return view('greeting', ['name' => 'James']);

Upvotes: 3

Related Questions