wirte a function that can be accessed in all views laravel code example Example: laravel load view in variable $html = view('users.edit', compact('user'))->render();