access variables in view laravel code example
Example 1: laravel load view in variable
$html = view('users.edit', compact('user'))->render();
Example 2: laravel pass variables to view
return view('home')->with('userName',$userName);
$html = view('users.edit', compact('user'))->render();
return view('home')->with('userName',$userName);