create a variable that is used across laravel project code example Example: laravel load view in variable $html = view('users.edit', compact('user'))->render();