close

How to get Blade template view as a raw HTML string?

Hello Guys, How are you all? Hope You all Are Fine. Today we are talking about How to get Blade template view as a raw HTML string? in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How to get Blade template view as a raw HTML string Error Occurs?

Today we are talking about How to get Blade template view as a raw HTML string? in php.

How To Solve get Blade template view as a raw HTML string Error ?

  1. How To Solve get Blade template view as a raw HTML string Error ?

    To Solve get Blade template view as a raw HTML string Error You can call render() on the view.
    $html = view('users.edit', compact('user'))->render();

  2. How to get Blade template view as a raw HTML string?

    To Solve get Blade template view as a raw HTML string Error You can call render() on the view.
    $html = view('users.edit', compact('user'))->render();

Solution 1

You can call render() on the view.

$html = view('users.edit', compact('user'))->render();

See the View source code for more information.

Solution 2

$var = view(‘nameView’, [‘name’ => ‘James’]); OR $name = “deree”; $var = view(‘nameView’, compact($name));

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment