compact in laravel 8 code example
Example 1: laravel load view in variable
$html = view('users.edit', compact('user'))->render();
Example 2: compact laravel
return View::make('myviewfolder.myview', compact('view1','view2','view3'));
$html = view('users.edit', compact('user'))->render();
return View::make('myviewfolder.myview', compact('view1','view2','view3'));